Mon Nov 21 18:25:54 2022 UTC ()
mk: Remove generic SunOS linker argument removals.

While these were useful in helping many packages to build out of the box,
it ended up resulting in some packages installing broken configuration
files as their configure tests for supported flags were passing.

For example, ruby packages were shipping an rbconfig.rb with LDFLAGS
containing -Wl,--no-as-needed, resulting in any ruby software built
outside of pkgsrc that required a compiler always failing.


(jperkin)
diff -r1.85 -r1.86 pkgsrc/mk/platform/SunOS.mk

cvs diff -r1.85 -r1.86 pkgsrc/mk/platform/SunOS.mk (expand / switch to unified diff)

--- pkgsrc/mk/platform/SunOS.mk 2022/10/01 14:23:26 1.85
+++ pkgsrc/mk/platform/SunOS.mk 2022/11/21 18:25:54 1.86
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: SunOS.mk,v 1.85 2022/10/01 14:23:26 jperkin Exp $ 1# $NetBSD: SunOS.mk,v 1.86 2022/11/21 18:25:54 jperkin Exp $
2# 2#
3# Variable definitions for the SunOS/Solaris operating system. 3# Variable definitions for the SunOS/Solaris operating system.
4 4
5ECHO_N?= ${ECHO} -n 5ECHO_N?= ${ECHO} -n
6IMAKE_MAKE?= ${MAKE} # program which gets invoked by imake 6IMAKE_MAKE?= ${MAKE} # program which gets invoked by imake
7PKGLOCALEDIR?= lib 7PKGLOCALEDIR?= lib
8PS?= /bin/ps 8PS?= /bin/ps
9# XXX: default from defaults/mk.conf. Verify/correct for this platform 9# XXX: default from defaults/mk.conf. Verify/correct for this platform
10# and remove this comment. 10# and remove this comment.
11SU?= /usr/bin/su 11SU?= /usr/bin/su
12TYPE?= /usr/bin/type 12TYPE?= /usr/bin/type
13 13
14CATMAN_SECTION_SUFFIX?= yes 14CATMAN_SECTION_SUFFIX?= yes
@@ -73,40 +73,26 @@ _OPSYS_MISSING_FEATURES= asprintf @@ -73,40 +73,26 @@ _OPSYS_MISSING_FEATURES= asprintf
73 73
74.if !exists(/usr/include/err.h) 74.if !exists(/usr/include/err.h)
75_OPSYS_MISSING_FEATURES+= err 75_OPSYS_MISSING_FEATURES+= err
76.endif 76.endif
77 77
78.if ${OPSYS_VERSION} < 051100 78.if ${OPSYS_VERSION} < 051100
79_OPSYS_MISSING_FEATURES+= strnlen 79_OPSYS_MISSING_FEATURES+= strnlen
80.endif 80.endif
81 81
82_PATCH_CAN_BACKUP= yes # native patch(1) can make backups 82_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
83_PATCH_BACKUP_ARG?= -b -V simple -z # switch to patch(1) for backup suffix 83_PATCH_BACKUP_ARG?= -b -V simple -z # switch to patch(1) for backup suffix
84_USE_RPATH= yes # add rpath to LDFLAGS 84_USE_RPATH= yes # add rpath to LDFLAGS
85 85
86# Remove flags specific to GNU ld. 
87BUILDLINK_TRANSFORM+= rm:-Wl,--as-needed 
88BUILDLINK_TRANSFORM+= rm:-Wl,--disable-new-dtags 
89BUILDLINK_TRANSFORM+= rm:-Wl,--enable-new-dtags 
90BUILDLINK_TRANSFORM+= rm:-Wl,--export-dynamic 
91BUILDLINK_TRANSFORM+= rm:-Wl,--gc-sections 
92BUILDLINK_TRANSFORM+= rm:-Wl,--no-as-needed 
93BUILDLINK_TRANSFORM+= rm:-Wl,--warn-common 
94BUILDLINK_TRANSFORM+= rm:-Wl,--warn-shared-textrel 
95BUILDLINK_TRANSFORM+= rm:-Wl,-O1 
96BUILDLINK_TRANSFORM+= rm:-Wl,-O2 
97BUILDLINK_TRANSFORM+= rm:-Wl,-export-dynamic 
98BUILDLINK_TRANSFORM+= rm:-export-dynamic 
99 
100# Convert GNU ld flags to native SunOS ld flags where possible. 86# Convert GNU ld flags to native SunOS ld flags where possible.
101BUILDLINK_TRANSFORM+= opt:-Wl,--rpath:-Wl,-R 87BUILDLINK_TRANSFORM+= opt:-Wl,--rpath:-Wl,-R
102 88
103# Remove GCC-specific flags if using clang 89# Remove GCC-specific flags if using clang
104.if ${PKGSRC_COMPILER} == "clang" 90.if ${PKGSRC_COMPILER} == "clang"
105BUILDLINK_TRANSFORM+= rm:-mimpure-text 91BUILDLINK_TRANSFORM+= rm:-mimpure-text
106.endif 92.endif
107 93
108# The native curses implementations are reasonably old and can cause lots of 94# The native curses implementations are reasonably old and can cause lots of
109# issues with software which assumes newer interfaces, so it's easier to just 95# issues with software which assumes newer interfaces, so it's easier to just
110# use pkgsrc curses at this point. Both curses and terminfo should be in sync 96# use pkgsrc curses at this point. Both curses and terminfo should be in sync
111# otherwise it's possible to end up with conflicting buildlink transforms. 97# otherwise it's possible to end up with conflicting buildlink transforms.
112# 98#