Mon Nov 27 14:45:40 2023 UTC ()
gcc12: Stop subverting buildlink with LDFLAGS.

It's not clear why this was ever added in the first place (back in gcc46),
but it results in the build gcc finding libraries in PREFIX that aren't
buildlinked.

Discovered on macOS with the indirect DEPENDS checks where iconv was being
pulled in directly from PREFIX.  While here fix a non-ASCII space.


(jperkin)
diff -r1.7 -r1.8 pkgsrc/lang/gcc12/Makefile

cvs diff -r1.7 -r1.8 pkgsrc/lang/gcc12/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/gcc12/Makefile 2023/10/20 10:37:32 1.7
+++ pkgsrc/lang/gcc12/Makefile 2023/11/27 14:45:40 1.8
@@ -1,41 +1,40 @@ @@ -1,41 +1,40 @@
1# $NetBSD: Makefile,v 1.7 2023/10/20 10:37:32 jperkin Exp $ 1# $NetBSD: Makefile,v 1.8 2023/11/27 14:45:40 jperkin Exp $
2 2
3PKGNAME= ${GCC_PKGNAME}-${GCC12_DIST_VERSION} 3PKGNAME= ${GCC_PKGNAME}-${GCC12_DIST_VERSION}
4## When bumping the PKGREVISION of this package the PKGREVISION of 4## When bumping the PKGREVISION of this package the PKGREVISION of
5## lang/gcc12-libs needs to be bumped to be at least 1 more than the 5## lang/gcc12-libs needs to be bumped to be at least 1 more than the
6## PKGREVISION of this package! 6## PKGREVISION of this package!
7COMMENT= The GNU Compiler Collection (GCC) - 12.0 Release Series 7COMMENT= The GNU Compiler Collection (GCC) - 12.0 Release Series
8 8
9LANGS= c 9LANGS= c
10 10
11.include "Makefile.common" 11.include "Makefile.common"
12 12
13# In some cases LINKER_RPATH_FLAG needs a trailing space. 13# In some cases LINKER_RPATH_FLAG needs a trailing space.
14LINKER_RPATH_FLAG:= ${LINKER_RPATH_FLAG:S/-rpath/& /} 14LINKER_RPATH_FLAG:= ${LINKER_RPATH_FLAG:S/-rpath/& /}
15 15
16## The Library rpath to use in end programs. 16LDFLAGS_FOR_TARGET= ${LDFLAGS:M-Wl,-z*}
17LDFLAGS_FOR_TARGET= ${LDFLAGS:M${COMPILER_RPATH_FLAG}*:N*/usr/lib*} ${LDFLAGS:M-Wl,-z*} 
18 17
19# The "-static-libstdc++ -static-libgcc" flags are normally added to the 18# The "-static-libstdc++ -static-libgcc" flags are normally added to the
20# boot-ldflags by configure but because we are supply the boot-ldflags 19# boot-ldflags by configure but because we are supply the boot-ldflags
21# we mash supply them. 20# we mash supply them.
22BOOT_LDFLAGS= -static-libstdc++ -static-libgcc ${LDFLAGS_FOR_TARGET} 21BOOT_LDFLAGS= -static-libstdc++ -static-libgcc ${LDFLAGS_FOR_TARGET}
23# Needed on Darwin when LDFLAGS point to a SDK 22# Needed on Darwin when LDFLAGS point to a SDK
24BOOT_LDFLAGS+= ${LDFLAGS:M-Wl,-syslibroot*} 23BOOT_LDFLAGS+= ${LDFLAGS:M-Wl,-syslibroot*}
25# GCC does not understand this option; remove it, or stage build will fail 24# GCC does not understand this option; remove it, or stage build will fail
26BUILDLINK_TRANSFORM+= rm:-stdlib=libc++ 25BUILDLINK_TRANSFORM+= rm:-stdlib=libc++
27 26
28# Work around ld bug in Xcode 15 27# Work around ld bug in Xcode 15
29.if ${OPSYS} == "Darwin" && ${CC_VERSION:Mclang-15.*} 28.if ${OPSYS} == "Darwin" && ${CC_VERSION:Mclang-15.*}
30LDFLAGS_FOR_TARGET+= -Wl,-ld_classic 29LDFLAGS_FOR_TARGET+= -Wl,-ld_classic
31.endif 30.endif
32 31
33# Disable fixincludes on SmartOS, header changes result in broken includes 32# Disable fixincludes on SmartOS, header changes result in broken includes
34# being generated, see https://github.com/joyent/pkgsrc-legacy/issues/270 33# being generated, see https://github.com/joyent/pkgsrc-legacy/issues/270
35.if ${OS_VARIANT} == "SmartOS" 34.if ${OS_VARIANT} == "SmartOS"
36SUBST_CLASSES+= fixinc 35SUBST_CLASSES+= fixinc
37SUBST_STAGE.fixinc= pre-configure 36SUBST_STAGE.fixinc= pre-configure
38SUBST_FILES.fixinc= gcc/Makefile.in 37SUBST_FILES.fixinc= gcc/Makefile.in
39SUBST_SED.fixinc= -e "s,\./fixinc.sh,-c true," 38SUBST_SED.fixinc= -e "s,\./fixinc.sh,-c true,"
40.endif 39.endif
41 40