Received: by mail.netbsd.org (Postfix, from userid 605) id 2D8F984F04; Tue, 9 Aug 2022 11:31:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 6697E84F00 for ; Tue, 9 Aug 2022 11:31:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 4E51qdBAJu9L for ; Tue, 9 Aug 2022 11:31:15 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 13E0184CD8 for ; Tue, 9 Aug 2022 11:31:15 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 0D589FB1A; Tue, 9 Aug 2022 11:31:15 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_166004467514720" MIME-Version: 1.0 Date: Tue, 9 Aug 2022 11:31:15 +0000 From: "Jonathan Perkin" Subject: CVS commit: pkgsrc To: pkgsrc-changes@NetBSD.org Reply-To: jperkin@netbsd.org X-Mailer: log_accum Message-Id: <20220809113115.0D589FB1A@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_166004467514720 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: jperkin Date: Tue Aug 9 11:31:14 UTC 2022 Modified Files: pkgsrc/converters/libiconv: buildlink3.mk pkgsrc/devel/gettext-lib: buildlink3.mk pkgsrc/mk/platform: SunOS.mk Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 pkgsrc/converters/libiconv/buildlink3.mk cvs rdiff -u -r1.40 -r1.41 pkgsrc/devel/gettext-lib/buildlink3.mk cvs rdiff -u -r1.82 -r1.83 pkgsrc/mk/platform/SunOS.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_166004467514720 Content-Disposition: inline Content-Length: 3836 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/converters/libiconv/buildlink3.mk diff -u pkgsrc/converters/libiconv/buildlink3.mk:1.26 pkgsrc/converters/libiconv/buildlink3.mk:1.27 --- pkgsrc/converters/libiconv/buildlink3.mk:1.26 Fri Mar 20 19:24:03 2009 +++ pkgsrc/converters/libiconv/buildlink3.mk Tue Aug 9 11:31:14 2022 @@ -1,4 +1,4 @@ -# $NetBSD: buildlink3.mk,v 1.26 2009/03/20 19:24:03 joerg Exp $ +# $NetBSD: buildlink3.mk,v 1.27 2022/08/09 11:31:14 jperkin Exp $ BUILDLINK_TREE+= iconv @@ -10,6 +10,24 @@ BUILDLINK_ABI_DEPENDS.iconv+= libiconv>= BUILDLINK_PKGSRCDIR.iconv?= ../../converters/libiconv BUILDLINK_LIBNAME.iconv= iconv BUILDLINK_LDADD.iconv= ${BUILDLINK_LIBNAME.iconv:S/^/-l/:S/^-l$//} + +.include "../../mk/bsd.fast.prefs.mk" + +# +# Due to Linux shipping libiconv in libc, third-party software often forgets to +# explicitly look for and add -liconv when required. On systems that use GNU +# ld this isn't always an issue as it will often be pulled in via an explicit +# library, but some systems have a stricter linker that will not pull in +# symbols via implicit dependencies, and so we need to explicitly link here. +# +# Ideally this would be done via CWRAPPERS_LDADD to avoid leaking into LDFLAGS +# but there is no concensus on that yet. +# +.if ${OPSYS_EXPLICIT_LIBDEPS:Uno:tl} == "yes" +BUILDLINK_LDFLAGS.iconv+= ${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.iconv}/lib +BUILDLINK_LDFLAGS.iconv+= ${BUILDLINK_LDADD.iconv} +.endif + .endif # ICONV_BUILDLINK3_MK BUILDLINK_TREE+= -iconv Index: pkgsrc/devel/gettext-lib/buildlink3.mk diff -u pkgsrc/devel/gettext-lib/buildlink3.mk:1.40 pkgsrc/devel/gettext-lib/buildlink3.mk:1.41 --- pkgsrc/devel/gettext-lib/buildlink3.mk:1.40 Sun Nov 3 10:39:12 2019 +++ pkgsrc/devel/gettext-lib/buildlink3.mk Tue Aug 9 11:31:14 2022 @@ -1,4 +1,4 @@ -# $NetBSD: buildlink3.mk,v 1.40 2019/11/03 10:39:12 rillig Exp $ +# $NetBSD: buildlink3.mk,v 1.41 2022/08/09 11:31:14 jperkin Exp $ BUILDLINK_TREE+= gettext @@ -27,6 +27,21 @@ BUILDLINK_LIBS.gettext+= ${BUILDLINK_LDA CONFIGURE_ENV+= INTLLIBS="${BUILDLINK_LDADD.gettext}" .endif +# +# Due to Linux shipping libintl in libc, third-party software often forgets to +# explicitly look for and add -lintl when required. On systems that use GNU +# ld this isn't always an issue as it will often be pulled in via an explicit +# library, but some systems have a stricter linker that will not pull in +# symbols via implicit dependencies, and so we need to explicitly link here. +# +# Ideally this would be done via CWRAPPERS_LDADD to avoid leaking into LDFLAGS +# but there is no concensus on that yet. +# +.if ${OPSYS_EXPLICIT_LIBDEPS:Uno:tl} == "yes" +BUILDLINK_LDFLAGS.gettext+= ${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.gettext}/lib +BUILDLINK_LDFLAGS.gettext+= ${BUILDLINK_LDADD.gettext} +.endif + CHECK_BUILTIN.gettext:= yes .include "../../devel/gettext-lib/builtin.mk" CHECK_BUILTIN.gettext:= no Index: pkgsrc/mk/platform/SunOS.mk diff -u pkgsrc/mk/platform/SunOS.mk:1.82 pkgsrc/mk/platform/SunOS.mk:1.83 --- pkgsrc/mk/platform/SunOS.mk:1.82 Mon Nov 29 16:14:23 2021 +++ pkgsrc/mk/platform/SunOS.mk Tue Aug 9 11:31:14 2022 @@ -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 _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. --_----------=_166004467514720--