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 (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,151 +1,137 @@ @@ -1,151 +1,137 @@
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
15CPP_PRECOMP_FLAGS?= # unset 15CPP_PRECOMP_FLAGS?= # unset
16DEF_UMASK?= 022 16DEF_UMASK?= 022
17DEFAULT_SERIAL_DEVICE?= /dev/null 17DEFAULT_SERIAL_DEVICE?= /dev/null
18EXPORT_SYMBOLS_LDFLAGS?= # Don't add symbols to the dynamic symbol table 18EXPORT_SYMBOLS_LDFLAGS?= # Don't add symbols to the dynamic symbol table
19GROUPADD?= /usr/sbin/groupadd 19GROUPADD?= /usr/sbin/groupadd
20NOLOGIN?= /usr/bin/false 20NOLOGIN?= /usr/bin/false
21ROOT_CMD?= ${SU} - root -c 21ROOT_CMD?= ${SU} - root -c
22ROOT_GROUP?= root 22ROOT_GROUP?= root
23ROOT_USER?= root 23ROOT_USER?= root
24SERIAL_DEVICES?= /dev/null 24SERIAL_DEVICES?= /dev/null
25ULIMIT_CMD_datasize?= ulimit -d `${SETENV} LC_MESSAGES=C ulimit -H -d` 25ULIMIT_CMD_datasize?= ulimit -d `${SETENV} LC_MESSAGES=C ulimit -H -d`
26ULIMIT_CMD_stacksize?= ulimit -s `${SETENV} LC_MESSAGES=C ulimit -H -s` 26ULIMIT_CMD_stacksize?= ulimit -s `${SETENV} LC_MESSAGES=C ulimit -H -s`
27ULIMIT_CMD_cputime?= ulimit -t `${SETENV} LC_MESSAGES=C ulimit -H -t` 27ULIMIT_CMD_cputime?= ulimit -t `${SETENV} LC_MESSAGES=C ulimit -H -t`
28ULIMIT_CMD_memorysize?= ulimit -v `${SETENV} LC_MESSAGES=C ulimit -H -v` 28ULIMIT_CMD_memorysize?= ulimit -v `${SETENV} LC_MESSAGES=C ulimit -H -v`
29USERADD?= /usr/sbin/useradd 29USERADD?= /usr/sbin/useradd
30 30
31.if exists(/usr/openwin/include/X11/X.h) 31.if exists(/usr/openwin/include/X11/X.h)
32X11_TYPE?= native 32X11_TYPE?= native
33.else 33.else
34X11_TYPE?= modular 34X11_TYPE?= modular
35.endif 35.endif
36.if ${X11_TYPE} == native 36.if ${X11_TYPE} == native
37MOTIF_TYPE_DEFAULT?= dt # default 2.0 compatible libs type 37MOTIF_TYPE_DEFAULT?= dt # default 2.0 compatible libs type
38.else 38.else
39MOTIF_TYPE_DEFAULT?= motif 39MOTIF_TYPE_DEFAULT?= motif
40.endif 40.endif
41 41
42# Use SMF by default if available. 42# Use SMF by default if available.
43.if ${OPSYS_VERSION} >= 051000 43.if ${OPSYS_VERSION} >= 051000
44INIT_SYSTEM?= smf 44INIT_SYSTEM?= smf
45.endif 45.endif
46 46
47# Comes with a builtin implementation based on mit-krb5 47# Comes with a builtin implementation based on mit-krb5
48KRB5_DEFAULT?= mit-krb5 48KRB5_DEFAULT?= mit-krb5
49 49
50# Builtin defaults which make sense for this platform. 50# Builtin defaults which make sense for this platform.
51_OPSYS_PREFER.getopt?= native 51_OPSYS_PREFER.getopt?= native
52_OPSYS_PREFER.libexecinfo?= native 52_OPSYS_PREFER.libexecinfo?= native
53_OPSYS_PREFER.openssl?= pkgsrc 53_OPSYS_PREFER.openssl?= pkgsrc
54_OPSYS_PREFER.solaris-pam?= native 54_OPSYS_PREFER.solaris-pam?= native
55 55
56_OPSYS_EMULDIR.solaris= # empty 56_OPSYS_EMULDIR.solaris= # empty
57_OPSYS_EMULDIR.solaris32= # empty 57_OPSYS_EMULDIR.solaris32= # empty
58_OPSYS_EMULDIR.sunos= # empty 58_OPSYS_EMULDIR.sunos= # empty
59 59
60.if exists(/usr/include/netinet/ip6.h) 60.if exists(/usr/include/netinet/ip6.h)
61_OPSYS_HAS_INET6= yes # IPv6 is standard 61_OPSYS_HAS_INET6= yes # IPv6 is standard
62.else 62.else
63_OPSYS_HAS_INET6= no # IPv6 is not standard 63_OPSYS_HAS_INET6= no # IPv6 is not standard
64.endif 64.endif
65_OPSYS_HAS_JAVA= no # Java is not standard 65_OPSYS_HAS_JAVA= no # Java is not standard
66_OPSYS_HAS_MANZ= no # no MANZ for gzipping of man pages 66_OPSYS_HAS_MANZ= no # no MANZ for gzipping of man pages
67_OPSYS_HAS_OSSAUDIO= no # libossaudio is available 67_OPSYS_HAS_OSSAUDIO= no # libossaudio is available
68_OPSYS_PERL_REQD= # no base version of perl required 68_OPSYS_PERL_REQD= # no base version of perl required
69_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads 69_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
70_OPSYS_SHLIB_TYPE= ELF # shared lib type 70_OPSYS_SHLIB_TYPE= ELF # shared lib type
71 71
72_OPSYS_MISSING_FEATURES= asprintf 72_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#
113_INCOMPAT_CURSES= SunOS-*-* 99_INCOMPAT_CURSES= SunOS-*-*
114_OPSYS_PREFER.terminfo?= pkgsrc 100_OPSYS_PREFER.terminfo?= pkgsrc
115 101
116# Solaris has /usr/include/iconv.h, but it's not GNU iconv, so mark it 102# Solaris has /usr/include/iconv.h, but it's not GNU iconv, so mark it
117# incompatible. 103# incompatible.
118_INCOMPAT_ICONV= SunOS-*-* 104_INCOMPAT_ICONV= SunOS-*-*
119 105
120_STRIPFLAG_CC?= ${_INSTALL_UNSTRIPPED:D:U-s} # cc(1) option to strip 106_STRIPFLAG_CC?= ${_INSTALL_UNSTRIPPED:D:U-s} # cc(1) option to strip
121_STRIPFLAG_INSTALL?= ${_INSTALL_UNSTRIPPED:D:U-s} # install(1) option to strip 107_STRIPFLAG_INSTALL?= ${_INSTALL_UNSTRIPPED:D:U-s} # install(1) option to strip
122 108
123PKG_TOOLS_BIN?= ${LOCALBASE}/sbin 109PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
124 110
125LIBABISUFFIX.sparc64= /sparcv9 111LIBABISUFFIX.sparc64= /sparcv9
126LIBABISUFFIX.x86_64= /amd64 112LIBABISUFFIX.x86_64= /amd64
127LIBABISUFFIX?= ${LIBABISUFFIX.${MACHINE_ARCH}} 113LIBABISUFFIX?= ${LIBABISUFFIX.${MACHINE_ARCH}}
128_OPSYS_SYSTEM_RPATH?= /lib${LIBABISUFFIX}:/usr/lib${LIBABISUFFIX} 114_OPSYS_SYSTEM_RPATH?= /lib${LIBABISUFFIX}:/usr/lib${LIBABISUFFIX}
129_OPSYS_LIB_DIRS?= /lib${LIBABISUFFIX} /usr/lib${LIBABISUFFIX} 115_OPSYS_LIB_DIRS?= /lib${LIBABISUFFIX} /usr/lib${LIBABISUFFIX}
130_OPSYS_INCLUDE_DIRS?= /usr/include 116_OPSYS_INCLUDE_DIRS?= /usr/include
131 117
132# Sun Studio support is untested at this time, but would be strongly desired. 118# Sun Studio support is untested at this time, but would be strongly desired.
133.if ${PKGSRC_COMPILER} != "sunpro" 119.if ${PKGSRC_COMPILER} != "sunpro"
134_OPSYS_SUPPORTS_CWRAPPERS= yes 120_OPSYS_SUPPORTS_CWRAPPERS= yes
135.endif 121.endif
136 122
137_OPSYS_SUPPORTS_CTF= yes # Compact Type Format conversion. 123_OPSYS_SUPPORTS_CTF= yes # Compact Type Format conversion.
138_OPSYS_SUPPORTS_FORTIFY= yes # Requires GCC 124_OPSYS_SUPPORTS_FORTIFY= yes # Requires GCC
139.if ${OPSYS_VERSION} >= 051100 125.if ${OPSYS_VERSION} >= 051100
140_OPSYS_SUPPORTS_MKTOOLS= yes # Requires err.h 126_OPSYS_SUPPORTS_MKTOOLS= yes # Requires err.h
141.endif 127.endif
142_OPSYS_SUPPORTS_SSP?= yes # Requires GCC 128_OPSYS_SUPPORTS_SSP?= yes # Requires GCC
143_OPSYS_CAN_CHECK_SHLIBS= yes # Requires readelf 129_OPSYS_CAN_CHECK_SHLIBS= yes # Requires readelf
144 130
145# The Solaris/illumos linker requires explicit library dependencies. 131# The Solaris/illumos linker requires explicit library dependencies.
146OPSYS_EXPLICIT_LIBDEPS= yes 132OPSYS_EXPLICIT_LIBDEPS= yes
147 133
148# check for maximum command line length and set it in configure's environment, 134# check for maximum command line length and set it in configure's environment,
149# to avoid a test required by the libtool script that takes forever. 135# to avoid a test required by the libtool script that takes forever.
150# FIXME: Adjust to work on this system and enable the lines below. 136# FIXME: Adjust to work on this system and enable the lines below.
151#_OPSYS_MAX_CMDLEN_CMD= /sbin/sysctl -n kern.argmax 137#_OPSYS_MAX_CMDLEN_CMD= /sbin/sysctl -n kern.argmax