Hello ports list, In December, I shared this lang/gcc/8 diff to fix egcc -static, before I got distracted. I recently returned to this diff and now confirm that it doesn't break the build of lang/octave and its dependencies (needing gcc for Fortran) on powerpc.
I want to commit this diff soon. If packages compiled by ports-gcc will break, then I will be at fault. This diff adds a %{!nostdlib:-L/usr/lib} for powerpc (in patch-gcc_config_rs6000_openbsd_h), so I can experiment with ld.lld on powerpc. I have not added %{!nostdlib:-L/usr/lib} to mips64* nor to sparc64. In the future, I want to port gcc to powerpc64 (so I can have a Fortran compiler on powerpc64). --George Index: Makefile =================================================================== RCS file: /cvs/ports/lang/gcc/8/Makefile,v retrieving revision 1.36 diff -u -p -r1.36 Makefile --- Makefile 14 Nov 2020 00:00:39 -0000 1.36 +++ Makefile 2 Dec 2020 04:27:15 -0000 @@ -18,7 +18,7 @@ DPB_PROPERTIES = parallel V = 8.4.0 FULL_VERSION = $V FULL_PKGVERSION = $V -REVISION = 1 +REVISION = 2 ADASTRAP-amd64 = adastrap-amd64-8.3.0-2.tar.xz ADASTRAP-arm = adastrap-arm-4.9.4-0.tar.xz Index: patches/patch-gcc_config_aarch64_openbsd_h =================================================================== RCS file: /cvs/ports/lang/gcc/8/patches/patch-gcc_config_aarch64_openbsd_h,v retrieving revision 1.2 diff -u -p -r1.2 patch-gcc_config_aarch64_openbsd_h --- patches/patch-gcc_config_aarch64_openbsd_h 20 May 2019 14:59:05 -0000 1.2 +++ patches/patch-gcc_config_aarch64_openbsd_h 2 Dec 2020 04:27:15 -0000 @@ -51,14 +51,14 @@ Index: gcc/config/aarch64/openbsd.h +#define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC + +#define LINK_SPEC \ -+ "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \ ++ "%{!shared:%{!nostdlib:%{!r:%{!e*:-e __start}}}} \ + %{shared:-shared} %{R*} \ + %{static:-Bstatic} \ + %{!static:-Bdynamic} \ + %{rdynamic:-export-dynamic} \ + %{assert*} \ -+ %{!shared:%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}} \ -+ -L/usr/lib" ++ %{!static:-dynamic-linker /usr/libexec/ld.so} \ ++ %{!nostdlib:-L/usr/lib}" + +#define OPENBSD_ENTRY_POINT "__start" + Index: patches/patch-gcc_config_alpha_openbsd_h =================================================================== RCS file: /cvs/ports/lang/gcc/8/patches/patch-gcc_config_alpha_openbsd_h,v retrieving revision 1.2 diff -u -p -r1.2 patch-gcc_config_alpha_openbsd_h --- patches/patch-gcc_config_alpha_openbsd_h 20 May 2019 14:59:05 -0000 1.2 +++ patches/patch-gcc_config_alpha_openbsd_h 2 Dec 2020 04:27:15 -0000 @@ -10,14 +10,14 @@ Index: gcc/config/alpha/openbsd.h +#define TARGET_DEFAULT \ + (MASK_FPREGS | MASK_IEEE | MASK_IEEE_CONFORMANT) + -+ #define LINK_SPEC \ -+ "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \ ++#define LINK_SPEC \ ++ "%{!shared:%{!nostdlib:%{!r:%{!e*:-e __start}}}} \ + %{shared:-shared} %{R*} \ + %{static:-Bstatic} \ + %{!static:-Bdynamic} \ + %{rdynamic:-export-dynamic} \ + %{assert*} \ -+ %{!shared:%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}}" ++ %{!static:-dynamic-linker /usr/libexec/ld.so}" + +/* As an elf system, we need crtbegin/crtend stuff. */ +#undef STARTFILE_SPEC Index: patches/patch-gcc_config_arm_openbsd_h =================================================================== RCS file: /cvs/ports/lang/gcc/8/patches/patch-gcc_config_arm_openbsd_h,v retrieving revision 1.2 diff -u -p -r1.2 patch-gcc_config_arm_openbsd_h --- patches/patch-gcc_config_arm_openbsd_h 20 May 2019 14:59:05 -0000 1.2 +++ patches/patch-gcc_config_arm_openbsd_h 2 Dec 2020 04:27:15 -0000 @@ -73,16 +73,16 @@ Index: gcc/config/arm/openbsd.h +#undef OBSD_LINK_SPEC +#ifdef OBSD_NO_DYNAMIC_LIBRARIES +#define OBSD_LINK_SPEC \ -+ "%{!nostdlib:%{!r*:%{!e*:-e __start}}} %{assert*}" ++ "%{!nostdlib:%{!r:%{!e*:-e __start}}} %{assert*}" +#else +#define OBSD_LINK_SPEC \ -+ "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \ ++ "%{!shared:%{!nostdlib:%{!r:%{!e*:-e __start}}}} \ + %{shared:-shared} %{R*} \ + %{static:-Bstatic} \ + %{!static:-Bdynamic} \ + %{rdynamic:-export-dynamic} \ + %{assert*} \ -+ %{!shared:%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}} \ ++ %{!static:-dynamic-linker /usr/libexec/ld.so} \ + %{!nostdlib:-L/usr/lib}" +#endif + Index: patches/patch-gcc_config_i386_openbsdelf_h =================================================================== RCS file: /cvs/ports/lang/gcc/8/patches/patch-gcc_config_i386_openbsdelf_h,v retrieving revision 1.3 diff -u -p -r1.3 patch-gcc_config_i386_openbsdelf_h --- patches/patch-gcc_config_i386_openbsdelf_h 8 Aug 2020 16:48:48 -0000 1.3 +++ patches/patch-gcc_config_i386_openbsdelf_h 2 Dec 2020 04:27:15 -0000 @@ -10,8 +10,8 @@ Index: gcc/config/i386/openbsdelf.h + %{rdynamic:-export-dynamic} \ %{assert*} \ - -dynamic-linker /usr/libexec/ld.so" -+ %{!shared:%{!-dynamic-linker:-dynamic-linker /usr/libexec/ld.so}} \ -+ -L/usr/lib" ++ %{!static:-dynamic-linker /usr/libexec/ld.so} \ ++ %{!nostdlib:-L/usr/lib}" #undef STARTFILE_SPEC -#define STARTFILE_SPEC "\ Index: patches/patch-gcc_config_mips_openbsd_h =================================================================== RCS file: /cvs/ports/lang/gcc/8/patches/patch-gcc_config_mips_openbsd_h,v retrieving revision 1.2 diff -u -p -r1.2 patch-gcc_config_mips_openbsd_h --- patches/patch-gcc_config_mips_openbsd_h 20 May 2019 14:59:05 -0000 1.2 +++ patches/patch-gcc_config_mips_openbsd_h 2 Dec 2020 04:27:15 -0000 @@ -142,7 +142,7 @@ Index: gcc/config/mips/openbsd.h + %{!static:-Bdynamic} \ + %{rdynamic:-export-dynamic} \ + %{assert*} \ -+ %{!shared:%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}}" ++ %{!static:-dynamic-linker /usr/libexec/ld.so}" + +/* As an elf system, we need crtbegin/crtend stuff. */ +#undef STARTFILE_SPEC Index: patches/patch-gcc_config_pa_pa-openbsd_h =================================================================== RCS file: /cvs/ports/lang/gcc/8/patches/patch-gcc_config_pa_pa-openbsd_h,v retrieving revision 1.2 diff -u -p -r1.2 patch-gcc_config_pa_pa-openbsd_h --- patches/patch-gcc_config_pa_pa-openbsd_h 20 May 2019 14:59:05 -0000 1.2 +++ patches/patch-gcc_config_pa_pa-openbsd_h 2 Dec 2020 04:27:15 -0000 @@ -9,7 +9,7 @@ Index: gcc/config/pa/pa-openbsd.h + %{rdynamic:-export-dynamic} \ %{assert*} \ - -dynamic-linker /usr/libexec/ld.so" -+ %{!shared:%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}}" ++ %{!static:-dynamic-linker /usr/libexec/ld.so}" #undef STARTFILE_SPEC #define STARTFILE_SPEC "\ Index: patches/patch-gcc_config_rs6000_openbsd_h =================================================================== RCS file: /cvs/ports/lang/gcc/8/patches/patch-gcc_config_rs6000_openbsd_h,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 patch-gcc_config_rs6000_openbsd_h --- patches/patch-gcc_config_rs6000_openbsd_h 4 Jan 2019 15:50:39 -0000 1.1.1.1 +++ patches/patch-gcc_config_rs6000_openbsd_h 2 Dec 2020 04:27:15 -0000 @@ -1,7 +1,8 @@ $OpenBSD: patch-gcc_config_rs6000_openbsd_h,v 1.1.1.1 2019/01/04 15:50:39 pascal Exp $ ---- gcc/config/rs6000/openbsd.h.orig Fri Nov 15 12:47:25 2013 -+++ gcc/config/rs6000/openbsd.h Fri Nov 15 12:49:07 2013 -@@ -0,0 +1,129 @@ +Index: gcc/config/rs6000/openbsd.h +--- gcc/config/rs6000/openbsd.h.orig ++++ gcc/config/rs6000/openbsd.h +@@ -0,0 +1,132 @@ +/* Configuration file for an rs6000 OpenBSD target. + Copyright (C) 1999 Free Software Foundation, Inc. + @@ -63,12 +64,15 @@ $OpenBSD: patch-gcc_config_rs6000_openbs +#define CPP_OS_DEFAULT_SPEC "%(cpp_os_openbsd)" + +#undef LINK_SPEC -+#define LINK_SPEC "%{shared:-shared} \ -+ %{!shared: \ -+ %{!static: \ -+ %{rdynamic:-export-dynamic} \ -+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}} \ -+ %{static:-static}}" ++#define LINK_SPEC \ ++ "%{!shared:%{!nostdlib:%{!r:%{!e*:-e __start}}}} \ ++ %{shared:-shared} %{R*} \ ++ %{static:-Bstatic} \ ++ %{!static:-Bdynamic} \ ++ %{rdynamic:-export-dynamic} \ ++ %{assert*} \ ++ %{!static:-dynamic-linker /usr/libexec/ld.so} \ ++ %{!nostdlib:-L/usr/lib}" + +#undef LIB_DEFAULT_SPEC +#define LIB_DEFAULT_SPEC "%(lib_openbsd)" Index: patches/patch-gcc_config_sparc_openbsd64_h =================================================================== RCS file: /cvs/ports/lang/gcc/8/patches/patch-gcc_config_sparc_openbsd64_h,v retrieving revision 1.2 diff -u -p -r1.2 patch-gcc_config_sparc_openbsd64_h --- patches/patch-gcc_config_sparc_openbsd64_h 20 May 2019 14:59:05 -0000 1.2 +++ patches/patch-gcc_config_sparc_openbsd64_h 2 Dec 2020 04:27:15 -0000 @@ -68,7 +68,7 @@ Index: gcc/config/sparc/openbsd64.h + %{rdynamic:-export-dynamic} \ %{assert*} \ - -dynamic-linker /usr/libexec/ld.so" -+ %{!shared:%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}}" ++ %{!static:-dynamic-linker /usr/libexec/ld.so}" /* As an elf system, we need crtbegin/crtend stuff. */ #undef STARTFILE_SPEC