summaryrefslogtreecommitdiff
path: root/mk/platform
diff options
context:
space:
mode:
authorjperkin <jperkin@pkgsrc.org>2022-08-09 11:31:14 +0000
committerjperkin <jperkin@pkgsrc.org>2022-08-09 11:31:14 +0000
commitde2c929e25f15120e317bd40fdb81f8e0839d938 (patch)
tree22e7f9244386c1988d9142db8f5d69f5220f13c6 /mk/platform
parentecc3fa2c92a5bb2a288c0d579ce803fcbb35b53a (diff)
downloadpkgsrc-de2c929e25f15120e317bd40fdb81f8e0839d938.tar.gz
mk: Add OPSYS_EXPLICIT_LIBDEPS and enable on SunOS.
Most systems use GNU ld, which will happily pull in symbols required by a program even if they are only available via implicit library dependencies. The SunOS linker is stricter, and if a program uses a symbol then the library that defines that symbol must be an explicit dependency. This mostly causes problems with libiconv and libintl, both of which Linux bundles in its C library, so a lot of third-party software does not correctly check for them. Until now we've had to add many, many overrides, along with variables such as BROKEN_GETTEXT_DETECTION which nowadays only has limited effectiveness. The situation appears to be getting worse, especially with software built with meson, and so both libiconv and gettext-lib will now automatically add the correct LDFLAGS if the OPSYS sets OPSYS_EXPLICIT_LIBDEPS=yes. This isn't perfect. For one it isn't really an OPSYS setting as you can try to use GNU ld on SunOS, it just doesn't work very well. It should also really be done via the wrappers rather than exposing LDFLAGS, but we do not yet have an approved patch for doing this. However it does improve the current situation.
Diffstat (limited to 'mk/platform')
-rw-r--r--mk/platform/SunOS.mk5
1 files changed, 4 insertions, 1 deletions
diff --git a/mk/platform/SunOS.mk b/mk/platform/SunOS.mk
index c3ec403cd6b..56e0c6f48f2 100644
--- a/mk/platform/SunOS.mk
+++ b/mk/platform/SunOS.mk
@@ -1,4 +1,4 @@
-# $NetBSD: SunOS.mk,v 1.82 2021/11/29 16:14:23 jperkin Exp $
+# $NetBSD: SunOS.mk,v 1.83 2022/08/09 11:31:14 jperkin Exp $
#
# Variable definitions for the SunOS/Solaris operating system.
@@ -139,6 +139,9 @@ _OPSYS_SUPPORTS_FORTIFY= yes # Requires GCC
_OPSYS_SUPPORTS_SSP?= yes # Requires GCC
_OPSYS_CAN_CHECK_SHLIBS= yes # Requires readelf
+# The Solaris/illumos linker requires explicit library dependencies.
+OPSYS_EXPLICIT_LIBDEPS= yes
+
# check for maximum command line length and set it in configure's environment,
# to avoid a test required by the libtool script that takes forever.
# FIXME: Adjust to work on this system and enable the lines below.