Folks,

here a diff and new bootstrap artifact to build macppc's gcc without bfd.

Because gcc caches inside which LD is used, we need a new bootstrap which is
available here:
https://kirill.korins.ky/pub/distfiles/gcc-bootstrap-powerpc-16.1.0-1.tar.xz

It was tested as:
1. gcc-16 with old bootstrap and only patch
2. make temprorary bootstrap
3. gcc-16 with temprorary bootstrap, patch and LLD
4. make final bootstrap
5. rebuild gcc with final bootstrap, patch and LLD

I think it is safe to commit before release.

This, we use RELOCATABLE_NEEDS_FIXUP at powerpc64 as well.

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/gcc/16/Makefile,v
diff -u -p -r1.19 Makefile
--- Makefile    10 Sep 2026 12:53:43 -0000      1.19
+++ Makefile    19 Sep 2026 20:39:02 -0000
@@ -20,7 +20,7 @@ USE_NOEXECONLY = Yes
 V = 16.1.0
 GCC_PKGSPEC = >=16,<17
 
-REVISION = 11
+REVISION = 12
 
 # aarch64, powerpc64 and sparc64 bootstrap contain only gdc
 BOOTSTRAP-aarch64 = gcc-bootstrap-aarch64-16.1.0-0.tar.xz
@@ -29,7 +29,7 @@ BOOTSTRAP-arm = gcc-bootstrap-arm-16.1.0
 BOOTSTRAP-hppa = adastrap-hppa-8.3.0-1.tar.xz
 BOOTSTRAP-i386 = gcc-bootstrap-i386-16.1.0-0.tar.xz
 BOOTSTRAP-mips64 = gcc-bootstrap-mips64-16.1.0-1.tar.xz
-BOOTSTRAP-powerpc = gcc-bootstrap-powerpc-16.1.0-0.tar.xz
+BOOTSTRAP-powerpc = gcc-bootstrap-powerpc-16.1.0-1.tar.xz
 BOOTSTRAP-powerpc64 = gcc-bootstrap-powerpc64-16.1.0-0.tar.xz
 BOOTSTRAP-riscv64 = gcc-bootstrap-riscv64-16.1.0-0.tar.xz
 BOOTSTRAP-sparc64 = gcc-bootstrap-sparc64-16.1.0-1.tar.xz
@@ -120,14 +120,6 @@ MAKE_FLAGS +=       ac_cv_path_mkdir=/bin/mkd
 
 CONFIGURE_ENV += ${EXTRA_ENV}
 MAKE_ENV += ${EXTRA_ENV}
-
-.if ${MACHINE_ARCH} == "powerpc"
-# powerpc lld can't link C++ code from gcc, "ld: error: relocation
-# refers to a discarded section:" .data.rel.ro.* or
-# .sdata.DW.ref.__gxx_personality_v0
-USE_LLD = No
-CONFIGURE_ENV += LDFLAGS="-Wl,--relax"
-.endif
 
 # Note: the configure target passes CFLAGS to the configure script anyways.
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/lang/gcc/16/distinfo,v
diff -u -p -r1.9 distinfo
--- distinfo    1 Sep 2026 22:28:55 -0000       1.9
+++ distinfo    19 Sep 2026 20:39:02 -0000
@@ -4,7 +4,7 @@ SHA256 (gcc/gcc-bootstrap-amd64-16.1.0-0
 SHA256 (gcc/gcc-bootstrap-arm-16.1.0-0.tar.xz) = 
ndwUrDAMJQscIld2dkVAHnIQwFmAUzxIPMA1rmx3LAc=
 SHA256 (gcc/gcc-bootstrap-i386-16.1.0-0.tar.xz) = 
Bx13vSVSmPcTdxtEuBo09V34Kk3WcJLHR+QcQdB3Q/k=
 SHA256 (gcc/gcc-bootstrap-mips64-16.1.0-1.tar.xz) = 
COeV2Pa/Ejq68sNqMbi4G0tVKBC6l2EYQfn2SKloczo=
-SHA256 (gcc/gcc-bootstrap-powerpc-16.1.0-0.tar.xz) = 
0zxtkr/FsgUnkrswi3pxBYUQJ35X0HaxUVeXeS/v6/w=
+SHA256 (gcc/gcc-bootstrap-powerpc-16.1.0-1.tar.xz) = 
zN3YQfrXzaqRJAgiE4Eyxt/6CXW9a0uuKpV9HuZlAp8=
 SHA256 (gcc/gcc-bootstrap-powerpc64-16.1.0-0.tar.xz) = 
2zEevZartfir4FoNIeP5UhWLUnZX4sqMnyisg7h4TNg=
 SHA256 (gcc/gcc-bootstrap-riscv64-16.1.0-0.tar.xz) = 
R4DaT0kLbPVlFXGF19+Bk9/dtfL+r348OPAUmmTnnWM=
 SHA256 (gcc/gcc-bootstrap-sparc64-16.1.0-1.tar.xz) = 
7FZ++qUTpA3i+2W3gbDEcndnFTFZSd9s9KKU5PyxTmA=
@@ -14,7 +14,7 @@ SIZE (gcc/gcc-bootstrap-amd64-16.1.0-0.t
 SIZE (gcc/gcc-bootstrap-arm-16.1.0-0.tar.xz) = 86586424
 SIZE (gcc/gcc-bootstrap-i386-16.1.0-0.tar.xz) = 134563524
 SIZE (gcc/gcc-bootstrap-mips64-16.1.0-1.tar.xz) = 113765716
-SIZE (gcc/gcc-bootstrap-powerpc-16.1.0-0.tar.xz) = 123967476
+SIZE (gcc/gcc-bootstrap-powerpc-16.1.0-1.tar.xz) = 123270236
 SIZE (gcc/gcc-bootstrap-powerpc64-16.1.0-0.tar.xz) = 94741772
 SIZE (gcc/gcc-bootstrap-riscv64-16.1.0-0.tar.xz) = 135909084
 SIZE (gcc/gcc-bootstrap-sparc64-16.1.0-1.tar.xz) = 60354124
Index: patches/patch-gcc_config_rs6000_openbsd_h
===================================================================
RCS file: /cvs/ports/lang/gcc/16/patches/patch-gcc_config_rs6000_openbsd_h,v
diff -u -p -r1.1.1.1 patch-gcc_config_rs6000_openbsd_h
--- patches/patch-gcc_config_rs6000_openbsd_h   2 Jun 2026 20:00:17 -0000       
1.1.1.1
+++ patches/patch-gcc_config_rs6000_openbsd_h   19 Sep 2026 20:39:02 -0000
@@ -1,7 +1,7 @@
 Index: gcc/config/rs6000/openbsd.h
 --- gcc/config/rs6000/openbsd.h.orig
 +++ gcc/config/rs6000/openbsd.h
-@@ -0,0 +1,132 @@
+@@ -0,0 +1,137 @@
 +/* Configuration file for an rs6000 OpenBSD target.
 +   Copyright (C) 1999 Free Software Foundation, Inc.
 +
@@ -134,3 +134,8 @@ Index: gcc/config/rs6000/openbsd.h
 +#undef TRAMPOLINE_SIZE
 +#define TRAMPOLINE_SIZE 40
 +
++/* We don't need to generate entries in .fixup, except when
++   -mrelocatable or -mrelocatable-lib is given.  */
++#undef RELOCATABLE_NEEDS_FIXUP
++#define RELOCATABLE_NEEDS_FIXUP \
++  (rs6000_isa_flags & rs6000_isa_flags_explicit & OPTION_MASK_RELOCATABLE)

-- 
wbr, Kirill

Reply via email to