pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkg/58963: gcc: LINK_LIBGCC_SPEC snafu
[cc various parties who have touched lang/gcc* in recent years]
I'm testing the attached patch series to restore the correct
LINK_LIBGCC_SPEC patches.
(These patches do not address the `package shouldn't REQUIRES its own
libraries' problem jperkin@ mentioned separately at
<https://mail-index.netbsd.org/tech-pkg/2025/01/06/msg030348.html>.)
I'm hoping that by patching _all_ of the gcc packages simultaneously,
across pkgsrc and wip, we can stamp out this problem so it doesn't
rear it's head again. If there are any other uncommitted copies of
gcc packages, please let me know where to find them!
I tried to make sure I got the PKGREVISION bumps and distinfo changes
right but I may have missed some spots -- review welcome.
Preliminary results suggest that these changes repair the immediate
problem with gcc10-libs REQUIRES and similar, but I haven't tried a
bulk build yet. gcc12 and gcc14 are not building for me on netbsd-9
at all, though, with problems like:
In file included from ../../../gcc-12.4.0/libgcc/unwind-dw2.c:35:
../../../gcc-12.4.0/libgcc/unwind-pe.h:100:8: error: unknown type name '_Unwind_Ptr'
100 | static _Unwind_Ptr
| ^~~~~~~~~~~
../../../gcc-12.4.0/libgcc/unwind-pe.h:131:39: error: unknown type name '_uleb128_t'
131 | read_uleb128 (const unsigned char *p, _uleb128_t *val)
| ^~~~~~~~~~
It is unclear to me whether the GCC_TARGET_MACHINE configuration knob
introduced by sbd@ and jperkin@ back in 2012 is still useful, but I
left it in just in case -- all the buildlink3.mk files still refer to
it. We can replace it by MACHINE_GNU_PLATFORM as a separate change if
it's not useful any more.
lang/gcc[789] use MACHINE_GNU_PLATFORM instead of GCC_TARGET_MACHINE.
If that's right, great, we'll leave it; if not, we can patch them to
use GCC_TARGET_MACHINE too.
I note that there are still some references to $(target_noncanonical)
in some old gcc-related packages (cross/mingw-w64-x86_64-gcc-msvcrt,
cross/mingw-w64-x86_64-gcc, lang/g95, lang/gcc-aux, lang/gcc5-aux,
lang/gcc6-aux), and it looks like GCC_TARGET_MACHINE was supposed to
replace that back in 2012 or so. Not clear to me whether these should
be patched to use GCC_TARGET_MACHINE too.
There are also a few patches to LINK_LIBGCC_SPEC that don't mention
GCC_TARGET_MACHINE (and have spurious spaces after LINKER_RPATH_FLAG)
but only in ancient packages, wip/gcc4[23456]. I left those alone.
From 96fb076d42fa28f604e7a112bfade82dee058728 Mon Sep 17 00:00:00 2001
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
Date: Mon, 6 Jan 2025 13:07:45 +0000
Subject: [PATCH 1/4] lang/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
---
lang/gcc10-aux/Makefile | 18 +++++++++++++++++-
lang/gcc10-aux/distinfo | 2 +-
lang/gcc10-aux/patches/patch-gcc_Makefile.in | 7 ++++---
lang/gcc10-libs/Makefile | 2 +-
lang/gcc10/Makefile | 2 +-
lang/gcc10/Makefile.common | 16 ++++++++++++++++
lang/gcc10/distinfo | 2 +-
lang/gcc10/patches/patch-gcc_Makefile.in | 2 +-
8 files changed, 42 insertions(+), 9 deletions(-)
diff --git a/lang/gcc10-aux/Makefile b/lang/gcc10-aux/Makefile
index 5431c3969c09..7165bb8f4ada 100644
--- a/lang/gcc10-aux/Makefile
+++ b/lang/gcc10-aux/Makefile
@@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.7 2023/08/15 13:49:17 tnn Exp $
GCC_PKGNAME= gcc10-aux
-PKGREVISION= 1
+PKGREVISION= 2
.include "version.mk"
DISTNAME= gcc-${GCC10_DIST_VERSION}
@@ -184,6 +184,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/lang/gcc10-aux/distinfo b/lang/gcc10-aux/distinfo
index 685734d54616..509e95bce68f 100644
--- a/lang/gcc10-aux/distinfo
+++ b/lang/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/lang/gcc10-aux/patches/patch-gcc_Makefile.in b/lang/gcc10-aux/patches/patch-gcc_Makefile.in
index 86b01e049fb8..dd3d3349b372 100644
--- a/lang/gcc10-aux/patches/patch-gcc_Makefile.in
+++ b/lang/gcc10-aux/patches/patch-gcc_Makefile.in
@@ -1,7 +1,8 @@
$NetBSD: patch-gcc_Makefile.in,v 1.1 2022/03/13 08:34:04 nia 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/lang/gcc10-libs/Makefile b/lang/gcc10-libs/Makefile
index 2699ebcaa47e..46bd38b21afc 100644
--- a/lang/gcc10-libs/Makefile
+++ b/lang/gcc10-libs/Makefile
@@ -9,7 +9,7 @@ PKGNAME= ${GCC_PKGNAME}-libs-${GCC10_DIST_VERSION}
## The PKGREVISION of this package needs to be at least 1 more than the
## PKGREVISION of the lang/gcc10 package so that with the dependence pattern
## '{gcc10,gcc10-libs}>=10.2.*' pkg_add will choose gcc10-libs over gcc10.
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= lang
MASTER_SITES= # empty
diff --git a/lang/gcc10/Makefile b/lang/gcc10/Makefile
index ea2098ab4e86..4c4963c2b350 100644
--- a/lang/gcc10/Makefile
+++ b/lang/gcc10/Makefile
@@ -4,7 +4,7 @@ PKGNAME= ${GCC_PKGNAME}-${GCC10_DIST_VERSION}
## When bumping the PKGREVISION of this package the PKGREVISION of
## lang/gcc10-libs needs to be bumped to be at least 1 more than the
## PKGREVISION of this package!
-PKGREVISION= 2
+PKGREVISION= 3
COMMENT= The GNU Compiler Collection (GCC) - 10.0 Release Series
diff --git a/lang/gcc10/Makefile.common b/lang/gcc10/Makefile.common
index b4c7eb4bfc09..c5fb3a1a9f88 100644
--- a/lang/gcc10/Makefile.common
+++ b/lang/gcc10/Makefile.common
@@ -138,6 +138,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/lang/gcc10/distinfo b/lang/gcc10/distinfo
index c91f1547843d..1129568ae045 100644
--- a/lang/gcc10/distinfo
+++ b/lang/gcc10/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) = a47571d8340702d1a86d0dfb7df654280c6a6ee6
+SHA1 (patch-gcc_Makefile.in) = ae324c5df0b5c4ba4ebae280039594043bb34e12
SHA1 (patch-gcc_config.gcc) = 4767d5b16794f4485879ed10e172cb2f86bc0777
SHA1 (patch-gcc_config.host) = 8920ce841f6088b365c9b590e3ea9535bd880b40
SHA1 (patch-gcc_config_aarch64_aarch64-builtins.c) = 87185f5c2e2dbe4195cb19fe6213d2d616d5519b
diff --git a/lang/gcc10/patches/patch-gcc_Makefile.in b/lang/gcc10/patches/patch-gcc_Makefile.in
index d2d2859edc2e..92a190e90ebc 100644
--- a/lang/gcc10/patches/patch-gcc_Makefile.in
+++ b/lang/gcc10/patches/patch-gcc_Makefile.in
@@ -11,7 +11,7 @@ Add a hack to increase the stack for genautomata on QNX.
# 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/\" \
From 8ea47e3036ba7f8a2d2dd4ada1804be81f1b164c Mon Sep 17 00:00:00 2001
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
Date: Mon, 6 Jan 2025 13:09:48 +0000
Subject: [PATCH 2/4] lang/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
---
lang/gcc12-libs/Makefile | 2 +-
lang/gcc12/Makefile | 1 +
lang/gcc12/Makefile.common | 16 ++++++++++++++++
lang/gcc12/distinfo | 2 +-
lang/gcc12/patches/patch-gcc_Makefile.in | 7 ++++---
5 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/lang/gcc12-libs/Makefile b/lang/gcc12-libs/Makefile
index 3c27060f0897..b728106d3d8f 100644
--- a/lang/gcc12-libs/Makefile
+++ b/lang/gcc12-libs/Makefile
@@ -9,7 +9,7 @@ PKGNAME= ${GCC_PKGNAME}-libs-${GCC12_DIST_VERSION}
## The PKGREVISION of this package needs to be at least 1 more than the
## PKGREVISION of the lang/gcc12 package so that with the dependence pattern
## '{gcc12,gcc12-libs}>=12.1.*' pkg_add will choose gcc12-libs over gcc12.
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= lang
MASTER_SITES= # empty
diff --git a/lang/gcc12/Makefile b/lang/gcc12/Makefile
index 709249c7cc98..37868d3d96cd 100644
--- a/lang/gcc12/Makefile
+++ b/lang/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/lang/gcc12/Makefile.common b/lang/gcc12/Makefile.common
index f022298cea88..e5b03ebf2aba 100644
--- a/lang/gcc12/Makefile.common
+++ b/lang/gcc12/Makefile.common
@@ -150,6 +150,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/lang/gcc12/distinfo b/lang/gcc12/distinfo
index 4ea2e1f2a3b2..087b6f33a955 100644
--- a/lang/gcc12/distinfo
+++ b/lang/gcc12/distinfo
@@ -9,7 +9,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/lang/gcc12/patches/patch-gcc_Makefile.in b/lang/gcc12/patches/patch-gcc_Makefile.in
index 1b21ab2c956d..4398eb10af3a 100644
--- a/lang/gcc12/patches/patch-gcc_Makefile.in
+++ b/lang/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/\" \
From 46adc39fe7e49f8b1e02fda72c6a8cf1c9b14476 Mon Sep 17 00:00:00 2001
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
Date: Mon, 6 Jan 2025 13:10:24 +0000
Subject: [PATCH 3/4] lang/gcc13*: Fix LINK_LIBGCC_SPEC.
PR pkg/58963: gcc: LINK_LIBGCC_SPEC snafu
PR pkg/48740: lang/gcc44 to gcc46 linker fails because of whitespace
---
lang/gcc13-gnat/Makefile | 17 +++++++++++++++++
lang/gcc13-gnat/distinfo | 2 +-
lang/gcc13-gnat/patches/patch-gcc_Makefile.in | 7 ++++---
lang/gcc13-libs/Makefile | 2 +-
lang/gcc13/Makefile | 1 +
lang/gcc13/Makefile.common | 16 ++++++++++++++++
lang/gcc13/distinfo | 2 +-
lang/gcc13/patches/patch-gcc_Makefile.in | 7 ++++---
8 files changed, 45 insertions(+), 9 deletions(-)
diff --git a/lang/gcc13-gnat/Makefile b/lang/gcc13-gnat/Makefile
index 5b7acb7d7d71..4edaaeaecdf4 100644
--- a/lang/gcc13-gnat/Makefile
+++ b/lang/gcc13-gnat/Makefile
@@ -4,6 +4,7 @@ GCC_PKGNAME=gcc13
.include "../../lang/${GCC_PKGNAME}/version.mk"
PKGNAME= ${GCC_PKGNAME}-gnat-${GCC13_DIST_VERSION}
+PKGREVISION= 1
COMMENT= GNAT Compiler and Ada tools
DISTNAME= gcc-${GCC13_DIST_VERSION}
CATEGORIES= lang
@@ -180,6 +181,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
TEST_TARGET= -j ${MAKE_JOBS} -k check || ${TRUE}
diff --git a/lang/gcc13-gnat/distinfo b/lang/gcc13-gnat/distinfo
index 17b8046a1b39..c08cc3a1a172 100644
--- a/lang/gcc13-gnat/distinfo
+++ b/lang/gcc13-gnat/distinfo
@@ -4,7 +4,7 @@ BLAKE2s (gcc-13.3.0.tar.xz) = d204b8987b4780b569f28226cbfff34ae27124e529857c36ff
SHA512 (gcc-13.3.0.tar.xz) = ed5f2f4c6ed2c796fcf2c93707159e9dbd3ddb1ba063d549804dd68cdabbb6d550985ae1c8465ae9a336cfe29274a6eb0f42e21924360574ebd8e5d5c7c9a801
Size (gcc-13.3.0.tar.xz) = 87909952 bytes
SHA1 (patch-fixincludes_inclhack.def) = 7b00974d3f52a8364190a607f52a5d7e8a6db41a
-SHA1 (patch-gcc_Makefile.in) = c0f97c75ba1d37eae894141edd58bb36b734f651
+SHA1 (patch-gcc_Makefile.in) = a31ddc27f1092cfdf5ac896ca79c8590b5aceb47
SHA1 (patch-gcc_ada_Makefile.rtl) = 59883834af5303b2e86a79d0df30a1a220ced895
SHA1 (patch-gcc_ada_adaint.c) = 465b3e3d6db193b2729f1d4e1c74eefcc3dc85bf
SHA1 (patch-gcc_ada_adaint.h) = 57befa67b18f97345db05672f1e53e8ec70e1935
diff --git a/lang/gcc13-gnat/patches/patch-gcc_Makefile.in b/lang/gcc13-gnat/patches/patch-gcc_Makefile.in
index 3c47abe5605f..f20239fd310c 100644
--- a/lang/gcc13-gnat/patches/patch-gcc_Makefile.in
+++ b/lang/gcc13-gnat/patches/patch-gcc_Makefile.in
@@ -1,7 +1,8 @@
$NetBSD: patch-gcc_Makefile.in,v 1.1 2024/03/08 12:02:33 wiz 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/lang/gcc13-libs/Makefile b/lang/gcc13-libs/Makefile
index fcaf8a3d5291..345c0410df34 100644
--- a/lang/gcc13-libs/Makefile
+++ b/lang/gcc13-libs/Makefile
@@ -9,7 +9,7 @@ PKGNAME= ${GCC_PKGNAME}-libs-${GCC13_DIST_VERSION}
## The PKGREVISION of this package needs to be at least 1 more than the
## PKGREVISION of the lang/gcc13 package so that with the dependence pattern
## '{gcc13,gcc13-libs}>=13.1.*' pkg_add will choose gcc13-libs over gcc13.
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= lang
MASTER_SITES= # empty
diff --git a/lang/gcc13/Makefile b/lang/gcc13/Makefile
index 63c2bc79f584..709901136d32 100644
--- a/lang/gcc13/Makefile
+++ b/lang/gcc13/Makefile
@@ -4,6 +4,7 @@ PKGNAME= ${GCC_PKGNAME}-${GCC13_DIST_VERSION}
## When bumping the PKGREVISION of this package the PKGREVISION of
## lang/gcc13-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) - 13.0 Release Series
LANGS= c
diff --git a/lang/gcc13/Makefile.common b/lang/gcc13/Makefile.common
index 92634037f038..6dd8ca60ac38 100644
--- a/lang/gcc13/Makefile.common
+++ b/lang/gcc13/Makefile.common
@@ -150,6 +150,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/lang/gcc13/distinfo b/lang/gcc13/distinfo
index ab267de1754b..b36fdf5edc62 100644
--- a/lang/gcc13/distinfo
+++ b/lang/gcc13/distinfo
@@ -10,7 +10,7 @@ BLAKE2s (isl-0.24.tar.xz) = a3013b0d39b7fe68a1b3e15dc7e925b347d555348ee946a80f53
SHA512 (isl-0.24.tar.xz) = ff6bdcff839e1cd473f2a0c1e4dd4a3612ec6fee4544ccbc62b530a7248db2cf93b4b99bf493a86ddf2aba00e768927265d5d411f92061ea85fd7929073428e8
Size (isl-0.24.tar.xz) = 1930956 bytes
SHA1 (patch-fixincludes_inclhack.def) = 7b00974d3f52a8364190a607f52a5d7e8a6db41a
-SHA1 (patch-gcc_Makefile.in) = c0f97c75ba1d37eae894141edd58bb36b734f651
+SHA1 (patch-gcc_Makefile.in) = a31ddc27f1092cfdf5ac896ca79c8590b5aceb47
SHA1 (patch-gcc_config.host) = bf95dd21bfdf79d173e745fbd35c9bb99fdf4087
SHA1 (patch-gcc_config_aarch64_aarch64-netbsd.h) = abf19e2445bce1773162bddef16cd7f41eb36827
SHA1 (patch-gcc_config_arm_arm.h) = 9d554349869d67d6393552c33a7824f0dd53cb11
diff --git a/lang/gcc13/patches/patch-gcc_Makefile.in b/lang/gcc13/patches/patch-gcc_Makefile.in
index 3cc3e1345d80..aa3bc75ed971 100644
--- a/lang/gcc13/patches/patch-gcc_Makefile.in
+++ b/lang/gcc13/patches/patch-gcc_Makefile.in
@@ -1,7 +1,8 @@
$NetBSD: patch-gcc_Makefile.in,v 1.1 2023/05/03 20:03:09 wiz 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/\" \
From 41b0bd6013552425b8ad61311456afbfb67a4848 Mon Sep 17 00:00:00 2001
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
Date: Mon, 6 Jan 2025 13:11:05 +0000
Subject: [PATCH 4/4] lang/gcc14*: Fix LINK_LIBGCC_SPEC.
PR pkg/58963: gcc: LINK_LIBGCC_SPEC snafu
PR pkg/48740: lang/gcc44 to gcc46 linker fails because of whitespace
---
lang/gcc14-libs/Makefile | 2 +-
lang/gcc14/Makefile | 1 +
lang/gcc14/Makefile.common | 16 ++++++++++++++++
lang/gcc14/distinfo | 2 +-
lang/gcc14/patches/patch-gcc_Makefile.in | 7 ++++---
5 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/lang/gcc14-libs/Makefile b/lang/gcc14-libs/Makefile
index d9136a11211f..6ba1b466b9ab 100644
--- a/lang/gcc14-libs/Makefile
+++ b/lang/gcc14-libs/Makefile
@@ -9,7 +9,7 @@ PKGNAME= ${GCC_PKGNAME}-libs-${GCC14_DIST_VERSION}
## The PKGREVISION of this package needs to be at least 1 more than the
## PKGREVISION of the lang/gcc14 package so that with the dependence pattern
## '{gcc14,gcc14-libs}>=14.1.*' pkg_add will choose gcc14-libs over gcc14.
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= lang
MASTER_SITES= # empty
diff --git a/lang/gcc14/Makefile b/lang/gcc14/Makefile
index 8ad9c5a03834..80d65ee7308f 100644
--- a/lang/gcc14/Makefile
+++ b/lang/gcc14/Makefile
@@ -4,6 +4,7 @@ PKGNAME= ${GCC_PKGNAME}-${GCC14_DIST_VERSION}
## When bumping the PKGREVISION of this package the PKGREVISION of
## lang/gcc14-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) - 14.0 Release Series
LANGS= c
diff --git a/lang/gcc14/Makefile.common b/lang/gcc14/Makefile.common
index ec006bb0a90c..275a3f23c732 100644
--- a/lang/gcc14/Makefile.common
+++ b/lang/gcc14/Makefile.common
@@ -150,6 +150,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/lang/gcc14/distinfo b/lang/gcc14/distinfo
index a47f1b83f781..b5e84e15830a 100644
--- a/lang/gcc14/distinfo
+++ b/lang/gcc14/distinfo
@@ -9,7 +9,7 @@ Size (gcc-14.2.0.tar.xz) = 92306460 bytes
BLAKE2s (isl-0.24.tar.xz) = a3013b0d39b7fe68a1b3e15dc7e925b347d555348ee946a80f5319a76973cd61
SHA512 (isl-0.24.tar.xz) = ff6bdcff839e1cd473f2a0c1e4dd4a3612ec6fee4544ccbc62b530a7248db2cf93b4b99bf493a86ddf2aba00e768927265d5d411f92061ea85fd7929073428e8
Size (isl-0.24.tar.xz) = 1930956 bytes
-SHA1 (patch-gcc_Makefile.in) = c0f97c75ba1d37eae894141edd58bb36b734f651
+SHA1 (patch-gcc_Makefile.in) = a31ddc27f1092cfdf5ac896ca79c8590b5aceb47
SHA1 (patch-gcc_config.host) = bf95dd21bfdf79d173e745fbd35c9bb99fdf4087
SHA1 (patch-gcc_config_aarch64_aarch64-netbsd.h) = abf19e2445bce1773162bddef16cd7f41eb36827
SHA1 (patch-gcc_config_arm_arm.h) = 9d554349869d67d6393552c33a7824f0dd53cb11
diff --git a/lang/gcc14/patches/patch-gcc_Makefile.in b/lang/gcc14/patches/patch-gcc_Makefile.in
index 61ad8d9fbb31..3edc9a1ab6a1 100644
--- a/lang/gcc14/patches/patch-gcc_Makefile.in
+++ b/lang/gcc14/patches/patch-gcc_Makefile.in
@@ -1,7 +1,8 @@
$NetBSD: patch-gcc_Makefile.in,v 1.1 2024/06/28 18:35:16 wiz 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/\" \
From f204218bc6fec7d0014763bd11a60f78aadff2ee Mon Sep 17 00:00:00 2001
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
Date: Mon, 6 Jan 2025 13:25:08 +0000
Subject: [PATCH 1/4] gcc9snapshot: Fix LINK_LIBGCC_SPEC.
PR pkg/58963: gcc: LINK_LIBGCC_SPEC snafu
PR pkg/48740: lang/gcc44 to gcc46 linker fails because of whitespace
---
gcc9snapshot/Makefile | 23 ++++++++++++++++------
gcc9snapshot/distinfo | 2 +-
gcc9snapshot/patches/patch-gcc_Makefile.in | 7 ++++---
3 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/gcc9snapshot/Makefile b/gcc9snapshot/Makefile
index 39e6867574..2afe2c1ca7 100644
--- a/gcc9snapshot/Makefile
+++ b/gcc9snapshot/Makefile
@@ -8,6 +8,7 @@ PKGNAME= ${GCC_PKGNAME}-${GCC9S_DIST_VERSION}
## When bumping the PKGREVISION of this package the PKGREVISION of
## lang/gcc9-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/${GCC9S_DIST_VERSION}/}
MASTER_SITES+= ftp://ftp.fu-berlin.de/unix/languages/gcc/snapshots/${GCC9S_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/gcc9snapshot/distinfo b/gcc9snapshot/distinfo
index c2175d26e8..cb4d236f59 100644
--- a/gcc9snapshot/distinfo
+++ b/gcc9snapshot/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) = 5c788878832f3b48d83941d2b36401abe8ece91c
SHA1 (patch-gcc_config_t-netbsd) = cb39774b614f1de64684cf2f4df337e7b40427d6
diff --git a/gcc9snapshot/patches/patch-gcc_Makefile.in b/gcc9snapshot/patches/patch-gcc_Makefile.in
index d52bcf4057..8674d3493d 100644
--- a/gcc9snapshot/patches/patch-gcc_Makefile.in
+++ b/gcc9snapshot/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/\" \
--
2.47.1
From 3a6682f78b7dce935e1a52c0de8e55e9d906ce1f Mon Sep 17 00:00:00 2001
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
Date: Mon, 6 Jan 2025 13:25:47 +0000
Subject: [PATCH 2/4] 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
---
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(-)
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/\" \
--
2.47.1
From f455e0e2c74f9a9294d1afb040597e661c4d42a3 Mon Sep 17 00:00:00 2001
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
Date: Mon, 6 Jan 2025 13:26:25 +0000
Subject: [PATCH 3/4] 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
---
gcc12/Makefile | 1 +
gcc12/Makefile.common | 16 ++++++++++++++++
gcc12/distinfo | 2 +-
gcc12/patches/patch-gcc_Makefile.in | 7 ++++---
4 files changed, 22 insertions(+), 4 deletions(-)
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 cfbb0f33c3..4d8a06aa3d 100644
--- a/gcc12/Makefile.common
+++ b/gcc12/Makefile.common
@@ -161,6 +161,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/\" \
--
2.47.1
From b938d2b5c38bba662a718f9115af140d7abd8a0e Mon Sep 17 00:00:00 2001
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
Date: Mon, 6 Jan 2025 13:26:34 +0000
Subject: [PATCH 4/4] gcc14*: Fix LINK_LIBGCC_SPEC.
PR pkg/58963: gcc: LINK_LIBGCC_SPEC snafu
PR pkg/48740: lang/gcc44 to gcc46 linker fails because of whitespace
---
gcc14/Makefile | 1 +
gcc14/Makefile.common | 16 ++++++++++++++++
gcc14/distinfo | 2 +-
gcc14/patches/patch-gcc_Makefile.in | 7 ++++---
4 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/gcc14/Makefile b/gcc14/Makefile
index 8ad9c5a038..80d65ee730 100644
--- a/gcc14/Makefile
+++ b/gcc14/Makefile
@@ -4,6 +4,7 @@ PKGNAME= ${GCC_PKGNAME}-${GCC14_DIST_VERSION}
## When bumping the PKGREVISION of this package the PKGREVISION of
## lang/gcc14-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) - 14.0 Release Series
LANGS= c
diff --git a/gcc14/Makefile.common b/gcc14/Makefile.common
index 853225259b..7f1524bcbd 100644
--- a/gcc14/Makefile.common
+++ b/gcc14/Makefile.common
@@ -147,6 +147,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/gcc14/distinfo b/gcc14/distinfo
index 48334294d7..e9ef70563f 100644
--- a/gcc14/distinfo
+++ b/gcc14/distinfo
@@ -10,7 +10,7 @@ SHA1 (patch-configure) = 7d9225f1d9f0297a8cdb19aca2e584fc67742226
SHA1 (patch-configure.ac) = d4229d5acd148959e8bfc2fd88745d7700828f72
SHA1 (patch-fixincludes_fixincl.x) = 8705769847cfecbaea393960e2894517a5a05e28
SHA1 (patch-fixincludes_inclhack.def) = 9a60dc8cbf702b374bf1e2a6c4e35009277301d9
-SHA1 (patch-gcc_Makefile.in) = c0f97c75ba1d37eae894141edd58bb36b734f651
+SHA1 (patch-gcc_Makefile.in) = a31ddc27f1092cfdf5ac896ca79c8590b5aceb47
SHA1 (patch-gcc_ada_init.c) = 2851bff6d8de6671de6f75d769522f09e1d4efa0
SHA1 (patch-gcc_builtins.cc) = 25b826dcd3553e5e5846a75bda7425eb9ef1f247
SHA1 (patch-gcc_c-family_c-attribs.cc) = a0d99cc37d3c048aa86e6d2114d0b4ab719070b7
diff --git a/gcc14/patches/patch-gcc_Makefile.in b/gcc14/patches/patch-gcc_Makefile.in
index 61ad8d9fbb..3edc9a1ab6 100644
--- a/gcc14/patches/patch-gcc_Makefile.in
+++ b/gcc14/patches/patch-gcc_Makefile.in
@@ -1,7 +1,8 @@
$NetBSD: patch-gcc_Makefile.in,v 1.1 2024/06/28 18:35:16 wiz 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/\" \
--
2.47.1
Home |
Main Index |
Thread Index |
Old Index