pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

gcc12*: Fix LINK_LIBGCC_SPEC.



Module Name:	pkgsrc-wip
Committed By:	Taylor R Campbell <riastradh%NetBSD.org@localhost>
Pushed By:	riastradh
Date:		Mon Jan 6 13:26:25 2025 +0000
Changeset:	021d8a8d0aff5effb54834d9d0c51a0305fdfc40

Modified Files:
	gcc12/Makefile
	gcc12/Makefile.common
	gcc12/distinfo
	gcc12/patches/patch-gcc_Makefile.in

Log Message:
gcc12*: Fix LINK_LIBGCC_SPEC.

PR pkg/58963: gcc: LINK_LIBGCC_SPEC snafu
PR pkg/48740: lang/gcc44 to gcc46 linker fails because of whitespace

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=021d8a8d0aff5effb54834d9d0c51a0305fdfc40

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 gcc12/Makefile                      |  1 +
 gcc12/Makefile.common               | 16 ++++++++++++++++
 gcc12/distinfo                      |  2 +-
 gcc12/patches/patch-gcc_Makefile.in |  7 ++++---
 4 files changed, 22 insertions(+), 4 deletions(-)

diffs:
diff --git a/gcc12/Makefile b/gcc12/Makefile
index 709249c7cc..37868d3d96 100644
--- a/gcc12/Makefile
+++ b/gcc12/Makefile
@@ -4,6 +4,7 @@ PKGNAME=	${GCC_PKGNAME}-${GCC12_DIST_VERSION}
 ## When bumping the PKGREVISION of this package the PKGREVISION of
 ## lang/gcc12-libs needs to be bumped to be at least 1 more than the
 ## PKGREVISION of this package!
+PKGREVISION=	1
 COMMENT=	The GNU Compiler Collection (GCC) - 12.0 Release Series
 
 LANGS=			c
diff --git a/gcc12/Makefile.common b/gcc12/Makefile.common
index 14cfc048d7..125269d016 100644
--- a/gcc12/Makefile.common
+++ b/gcc12/Makefile.common
@@ -160,6 +160,22 @@ SUBST_FILES.ccs=	contrib/make_sunver.pl
 SUBST_SED.ccs=		-e 's,/usr/ccs/bin,/usr/bin,g'
 .endif
 
+# DO NOT REMOVE THIS SUBST.  If it fails, the corruption to
+# patch-gcc_Makefile.in chronicled in PR pkg/58963 `gcc:
+# LINK_LIBGCC_SPEC snafu' <https://gnats.NetBSD.org/58963> probably got
+# replicated yet again.  You must make sure that LINK_LIBGCC_SPEC is
+# appropriately set with @GCC_TARGET_MACHINE@ in patch-gcc_Makefile.in
+# or similar, or confirm with a discussion on tech-pkg@ that it is no
+# longer relevant before you remove this SUBST.
+SUBST_CLASSES+=		vars
+SUBST_MESSAGE.vars=	Setting target machine name path in ${SUBST_FILES.vars}
+SUBST_STAGE.vars=	pre-configure
+SUBST_FILES.vars=	gcc/Makefile.in
+SUBST_VARS.vars=	GCC_TARGET_MACHINE
+
+GCC_TARGET_MACHINE?=	${MACHINE_GNU_PLATFORM}
+BUILD_DEFS+=		GCC_TARGET_MACHINE
+
 pre-configure:
 	${RUN} cd ${WRKSRC} && ${MKDIR} ${OBJDIR}
 
diff --git a/gcc12/distinfo b/gcc12/distinfo
index 78ab02b3c4..babd6676e9 100644
--- a/gcc12/distinfo
+++ b/gcc12/distinfo
@@ -15,7 +15,7 @@ Size (gcc-12.4.0.tar.xz) = 83377372 bytes
 BLAKE2s (isl-0.16.1.tar.bz2) = 01c3fc657326e81414986eb7ede6f73e540b97009745ced125cdf7f4a8d80f61
 SHA512 (isl-0.16.1.tar.bz2) = c188667a84dc5bdddb4ab7c35f89c91bf15a8171f4fcaf41301cf285fb7328846d9a367c096012fec4cc69d244f0bc9e95d84c09ec097394cd4093076f2a041b
 Size (isl-0.16.1.tar.bz2) = 1626446 bytes
-SHA1 (patch-gcc_Makefile.in) = c0f97c75ba1d37eae894141edd58bb36b734f651
+SHA1 (patch-gcc_Makefile.in) = a31ddc27f1092cfdf5ac896ca79c8590b5aceb47
 SHA1 (patch-gcc_config.gcc) = 260f187048260e539e928bb04594b6394bb03912
 SHA1 (patch-gcc_config.host) = bf95dd21bfdf79d173e745fbd35c9bb99fdf4087
 SHA1 (patch-gcc_config_aarch64_aarch64-netbsd.h) = abf19e2445bce1773162bddef16cd7f41eb36827
diff --git a/gcc12/patches/patch-gcc_Makefile.in b/gcc12/patches/patch-gcc_Makefile.in
index 1b21ab2c95..4398eb10af 100644
--- a/gcc12/patches/patch-gcc_Makefile.in
+++ b/gcc12/patches/patch-gcc_Makefile.in
@@ -1,7 +1,8 @@
 $NetBSD: patch-gcc_Makefile.in,v 1.1 2022/06/16 15:43:55 adam Exp $
 
-Add gcc libdir to a programs rpath so that _this gcc's_ support libraries
-are found.
+Ensure libgcc from this GCC is found before others.  Note that there must
+not be a whitespace between $(LINKER_RPATH_FLAG) and the path.  Otherwise
+the flag may be misinterpreted by the linker (e.g. Apple ld).
 
 --- gcc/Makefile.in.orig	2017-04-18 18:10:27.000000000 +0000
 +++ gcc/Makefile.in
@@ -9,7 +10,7 @@ are found.
  # Language-independent files.
  
  DRIVER_DEFINES = \
-+  -DLINK_LIBGCC_SPEC="\"%D $(LINKER_RPATH_FLAG) $(prefix)//lib/%M $(LINKER_RPATH_FLAG) $(libdir)/%M \"" \
++  -DLINK_LIBGCC_SPEC="\"%D $(LINKER_RPATH_FLAG)$(prefix)/@GCC_TARGET_MACHINE@/lib/%M $(LINKER_RPATH_FLAG)$(libdir)/%M \"" \
    -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
    -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
    -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \


Home | Main Index | Thread Index | Old Index