On Wed, Sep 09, 2020 at 11:42:27AM -0700, j...@bitminer.ca wrote:
> As recommended by Brad, I've updated the fixes
> for all necessary platforms so that -static
> works.
> 
> Some platforms already had something like this so this
> set of patches is for a subset of all platforms.
> 
> Only tested on amd64.
> 
> John

I had a similar diff as to yours. I also added keeping the PowerPC config in 
sync
which I noticed had not been kept in sync with the rest.

I was just waiting for George to do some testing on PowerPC.


Index: Makefile
===================================================================
RCS file: /home/cvs/ports/lang/gcc/8/Makefile,v
retrieving revision 1.34
diff -u -p -u -p -r1.34 Makefile
--- Makefile    4 Sep 2020 09:55:34 -0000       1.34
+++ Makefile    13 Sep 2020 00:55:40 -0000
@@ -18,6 +18,7 @@ DPB_PROPERTIES = parallel
 V = 8.4.0
 FULL_VERSION = $V
 FULL_PKGVERSION = $V
+REVISION = 0
 
 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: 
/home/cvs/ports/lang/gcc/8/patches/patch-gcc_config_aarch64_openbsd_h,v
retrieving revision 1.2
diff -u -p -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  4 Sep 2020 20:18:32 -0000
@@ -57,7 +57,7 @@ Index: gcc/config/aarch64/openbsd.h
 +   %{!static:-Bdynamic} \
 +   %{rdynamic:-export-dynamic} \
 +   %{assert*} \
-+   %{!shared:%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}} \
++   %{!shared:%{!static:%{!-dynamic-linker:-dynamic-linker 
/usr/libexec/ld.so}}} \
 +   -L/usr/lib"
 +
 +#define OPENBSD_ENTRY_POINT "__start"
Index: patches/patch-gcc_config_alpha_openbsd_h
===================================================================
RCS file: /home/cvs/ports/lang/gcc/8/patches/patch-gcc_config_alpha_openbsd_h,v
retrieving revision 1.2
diff -u -p -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    13 Sep 2020 00:52:52 -0000
@@ -17,7 +17,7 @@ Index: gcc/config/alpha/openbsd.h
 +   %{!static:-Bdynamic} \
 +   %{rdynamic:-export-dynamic} \
 +   %{assert*} \
-+   %{!shared:%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}}"
++   %{!shared:%{!static:%{!dynamic-linker:-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: /home/cvs/ports/lang/gcc/8/patches/patch-gcc_config_arm_openbsd_h,v
retrieving revision 1.2
diff -u -p -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      4 Sep 2020 20:18:32 -0000
@@ -82,7 +82,7 @@ Index: gcc/config/arm/openbsd.h
 +   %{!static:-Bdynamic} \
 +   %{rdynamic:-export-dynamic} \
 +   %{assert*} \
-+   %{!shared:%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}} \
++   %{!shared:%{!static:%{!-dynamic-linker:-dynamic-linker 
/usr/libexec/ld.so}}} \
 +   %{!nostdlib:-L/usr/lib}"
 +#endif
 +
Index: patches/patch-gcc_config_i386_openbsdelf_h
===================================================================
RCS file: 
/home/cvs/ports/lang/gcc/8/patches/patch-gcc_config_i386_openbsdelf_h,v
retrieving revision 1.3
diff -u -p -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  9 Sep 2020 22:21:06 -0000
@@ -3,26 +3,28 @@ $OpenBSD: patch-gcc_config_i386_openbsde
 Index: gcc/config/i386/openbsdelf.h
 --- gcc/config/i386/openbsdelf.h.orig
 +++ gcc/config/i386/openbsdelf.h
-@@ -97,14 +97,18 @@ along with GCC; see the file COPYING3.  If not see
+@@ -97,16 +97,20 @@ along with GCC; see the file COPYING3.  If not see
     %{shared:-shared} %{R*} \
     %{static:-Bstatic} \
     %{!static:-Bdynamic} \
 +   %{rdynamic:-export-dynamic} \
     %{assert*} \
 -   -dynamic-linker /usr/libexec/ld.so"
-+   %{!shared:%{!-dynamic-linker:-dynamic-linker /usr/libexec/ld.so}} \
++   %{!shared:%{!static:%{!-dynamic-linker:-dynamic-linker 
/usr/libexec/ld.so}}} \
 +   -L/usr/lib"
  
  #undef STARTFILE_SPEC
--#define STARTFILE_SPEC "\
+ #define STARTFILE_SPEC "\
 -      %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \
 -      crtbegin%O%s} %{shared:crtbeginS%O%s}"
- 
-+#define SUBTARGET32_DEFAULT_CPU "i586"
-+#define STARTFILE_SPEC "\
+-
 +      %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} \
 +      %{!p:%{!static:crt0%O%s} %{static:%{nopie:crt0%O%s} \
 +      %{!nopie:rcrt0%O%s}}}} crtbegin%O%s} %{shared:crtbeginS%O%s}"
  #undef ENDFILE_SPEC
  #define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
++
++#define SUBTARGET32_DEFAULT_CPU "i586"
+ 
+ #define OBSD_HAS_CORRECT_SPECS
  
Index: patches/patch-gcc_config_mips_openbsd_h
===================================================================
RCS file: /home/cvs/ports/lang/gcc/8/patches/patch-gcc_config_mips_openbsd_h,v
retrieving revision 1.2
diff -u -p -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     4 Sep 2020 20:18:32 -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}}"
++   %{!shared:%{!static:%{!-dynamic-linker:-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: /home/cvs/ports/lang/gcc/8/patches/patch-gcc_config_pa_pa-openbsd_h,v
retrieving revision 1.2
diff -u -p -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    9 Sep 2020 22:21:06 -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}}"
++   %{!shared:%{!static:%{!-dynamic-linker:-dynamic-linker 
/usr/libexec/ld.so}}}"
  
  #undef STARTFILE_SPEC
  #define STARTFILE_SPEC "\
Index: patches/patch-gcc_config_rs6000_openbsd_h
===================================================================
RCS file: /home/cvs/ports/lang/gcc/8/patches/patch-gcc_config_rs6000_openbsd_h,v
retrieving revision 1.1.1.1
diff -u -p -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   6 Sep 2020 03:04:37 -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,131 @@
 +/* Configuration file for an rs6000 OpenBSD target.
 +   Copyright (C) 1999 Free Software Foundation, Inc.
 +
@@ -63,12 +64,14 @@ $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*} \
++   %{!shared:%{!static:%{!-dynamic-linker:-dynamic-linker 
/usr/libexec/ld.so}}}"
 +
 +#undef        LIB_DEFAULT_SPEC
 +#define LIB_DEFAULT_SPEC "%(lib_openbsd)"
Index: patches/patch-gcc_config_sparc_openbsd64_h
===================================================================
RCS file: 
/home/cvs/ports/lang/gcc/8/patches/patch-gcc_config_sparc_openbsd64_h,v
retrieving revision 1.2
diff -u -p -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  9 Sep 2020 22:21:06 -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}}"
++   %{!shared:%{!static:%{!-dynamic-linker:-dynamic-linker 
/usr/libexec/ld.so}}}"
  
  /* As an elf system, we need crtbegin/crtend stuff.  */
  #undef STARTFILE_SPEC

Reply via email to