pkgsrc-WIP-changes archive

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

gcc10*: 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:25:47 2025 +0000
Changeset:	3418f47bb954c0842992bc703bbf07e906007135

Modified Files:
	gcc10-aux/Makefile
	gcc10-aux/distinfo
	gcc10-aux/patches/patch-gcc_Makefile.in
	gcc10snapshot/Makefile
	gcc10snapshot/distinfo
	gcc10snapshot/patches/patch-gcc_Makefile.in

Log Message:
gcc10*: 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=3418f47bb954c0842992bc703bbf07e906007135

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

diffstat:
 gcc10-aux/Makefile                          | 17 +++++++++++++++++
 gcc10-aux/distinfo                          |  2 +-
 gcc10-aux/patches/patch-gcc_Makefile.in     |  7 ++++---
 gcc10snapshot/Makefile                      | 23 +++++++++++++++++------
 gcc10snapshot/distinfo                      |  2 +-
 gcc10snapshot/patches/patch-gcc_Makefile.in |  7 ++++---
 6 files changed, 44 insertions(+), 14 deletions(-)

diffs:
diff --git a/gcc10-aux/Makefile b/gcc10-aux/Makefile
index 6697ab701e..28d6c602d7 100644
--- a/gcc10-aux/Makefile
+++ b/gcc10-aux/Makefile
@@ -5,6 +5,7 @@ GCC_PKGNAME=		gcc10-aux
 
 DISTNAME=	gcc-${GCC10_DIST_VERSION}
 PKGNAME=	${GCC_PKGNAME}-${GCC10_DIST_VERSION}
+PKGREVISION=	1
 CATEGORIES=	lang
 MASTER_SITES=	${MASTER_SITE_GNU:=gcc/gcc-${GCC10_DIST_VERSION}/}
 EXTRACT_SUFX=	.tar.xz
@@ -177,6 +178,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
+
 CTF_FILES_SKIP+=	*/gengtype	# CPU limit exceeded
 
 pre-configure:
diff --git a/gcc10-aux/distinfo b/gcc10-aux/distinfo
index 48ecb65ba1..3378032a6b 100644
--- a/gcc10-aux/distinfo
+++ b/gcc10-aux/distinfo
@@ -8,7 +8,7 @@ SHA512 (isl-0.16.1.tar.bz2) = c188667a84dc5bdddb4ab7c35f89c91bf15a8171f4fcaf4130
 Size (isl-0.16.1.tar.bz2) = 1626446 bytes
 SHA1 (patch-contrib_download__prerequisites) = 9cdcde21ab174052911447d20762ddfd40aa8791
 SHA1 (patch-fixincludes_inclhack.def) = 7b00974d3f52a8364190a607f52a5d7e8a6db41a
-SHA1 (patch-gcc_Makefile.in) = c0f97c75ba1d37eae894141edd58bb36b734f651
+SHA1 (patch-gcc_Makefile.in) = a31ddc27f1092cfdf5ac896ca79c8590b5aceb47
 SHA1 (patch-gcc_ada_Makefile.rtl) = 1b6a18dce5ffe752be942f6e328d487692f3b33a
 SHA1 (patch-gcc_ada_adaint.c) = 465b3e3d6db193b2729f1d4e1c74eefcc3dc85bf
 SHA1 (patch-gcc_ada_adaint.h) = 57befa67b18f97345db05672f1e53e8ec70e1935
diff --git a/gcc10-aux/patches/patch-gcc_Makefile.in b/gcc10-aux/patches/patch-gcc_Makefile.in
index cd32c67b2f..4d0a2137fb 100644
--- a/gcc10-aux/patches/patch-gcc_Makefile.in
+++ b/gcc10-aux/patches/patch-gcc_Makefile.in
@@ -1,7 +1,8 @@
 $NetBSD: patch-gcc_Makefile.in,v 1.1 2020/05/10 15:02:44 maya 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/\" \
diff --git a/gcc10snapshot/Makefile b/gcc10snapshot/Makefile
index 4b3bd05ff0..58c77e4445 100644
--- a/gcc10snapshot/Makefile
+++ b/gcc10snapshot/Makefile
@@ -8,6 +8,7 @@ PKGNAME=	${GCC_PKGNAME}-${GCC10S_DIST_VERSION}
 ## When bumping the PKGREVISION of this package the PKGREVISION of
 ## lang/gcc10-libs needs to be bump to be at least 1 more than the
 ## PKGREVISION of this package!
+PKGREVISION=	1
 CATEGORIES=	lang
 #MASTER_SITES=	${MASTER_SITE_GNU:=gcc/snapshots/${GCC10S_DIST_VERSION}/}
 MASTER_SITES+=	ftp://ftp.fu-berlin.de/unix/languages/gcc/snapshots/${GCC10S_DIST_VERSION}/
@@ -40,12 +41,6 @@ INFO_FILES=		yes
 UNLIMIT_RESOURCES+=	datasize
 UNLIMIT_RESOURCES+=	stacksize
 
-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
-
 
 .include "../../mk/bsd.prefs.mk"
 
@@ -145,6 +140,22 @@ CONFIGURE_ARGS+=	--with-gnu-as --with-as=${PREFIX}/bin/gas
 .  endif
 .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}
 	${CP} ${FILESDIR}/netbsd-d.c ${WRKSRC}/gcc/config/
diff --git a/gcc10snapshot/distinfo b/gcc10snapshot/distinfo
index 9c6e2140e1..273ace08db 100644
--- a/gcc10snapshot/distinfo
+++ b/gcc10snapshot/distinfo
@@ -7,7 +7,7 @@ RMD160 (isl-0.16.1.tar.bz2) = 5a99db3fe0d0a1f6bbac1ed4448f2403495c55b2
 SHA512 (isl-0.16.1.tar.bz2) = c188667a84dc5bdddb4ab7c35f89c91bf15a8171f4fcaf41301cf285fb7328846d9a367c096012fec4cc69d244f0bc9e95d84c09ec097394cd4093076f2a041b
 Size (isl-0.16.1.tar.bz2) = 1626446 bytes
 SHA1 (patch-contrib_download__prerequisites) = 86c6c16e0e3e3a0bcb38579a8b4004f603fac1ca
-SHA1 (patch-gcc_Makefile.in) = c0f97c75ba1d37eae894141edd58bb36b734f651
+SHA1 (patch-gcc_Makefile.in) = a31ddc27f1092cfdf5ac896ca79c8590b5aceb47
 SHA1 (patch-gcc_config_arm_arm.h) = ef381dbb70cab2f76f6ad190eaa5519240ae1a02
 SHA1 (patch-gcc_config_netbsd-protos.h) = ff3d5c6602f57ca28d3a9c0636c5224465fa9c17
 SHA1 (patch-gcc_config_x-netbsd) = 9dc75bfab8331b5223efc382aae5f577fb6e1b7b
diff --git a/gcc10snapshot/patches/patch-gcc_Makefile.in b/gcc10snapshot/patches/patch-gcc_Makefile.in
index d52bcf4057..8674d3493d 100644
--- a/gcc10snapshot/patches/patch-gcc_Makefile.in
+++ b/gcc10snapshot/patches/patch-gcc_Makefile.in
@@ -1,7 +1,8 @@
 $NetBSD: patch-gcc_Makefile.in,v 1.1 2017/05/03 00:21:03 maya 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