pkgsrc-Changes archive

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

CVS commit: pkgsrc/lang/gcc10



Module Name:    pkgsrc
Committed By:   mrg
Date:           Wed Feb  2 22:07:28 UTC 2022

Modified Files:
        pkgsrc/lang/gcc10: distinfo
        pkgsrc/lang/gcc10/patches: patch-gcc_config.gcc
            patch-libgcc_config.host
Added Files:
        pkgsrc/lang/gcc10/patches: patch-gcc_config_arm_arm.h
            patch-gcc_config_arm_bpabi.h patch-gcc_config_arm_elf.h
            patch-gcc_config_arm_netbsd-eabi.h
            patch-gcc_config_arm_netbsd-elf.h

Log Message:
pull over the rest of netbsd arm32 configuration from -current.

fixes PR#56679.  (tested in armv7hf-el chroot on armv8, and also tested
doesn't break amd64 version.)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 pkgsrc/lang/gcc10/distinfo
cvs rdiff -u -r1.2 -r1.3 pkgsrc/lang/gcc10/patches/patch-gcc_config.gcc
cvs rdiff -u -r0 -r1.1 pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_arm.h \
    pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_bpabi.h \
    pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_elf.h \
    pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_netbsd-eabi.h \
    pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_netbsd-elf.h
cvs rdiff -u -r1.1 -r1.2 pkgsrc/lang/gcc10/patches/patch-libgcc_config.host

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

Modified files:

Index: pkgsrc/lang/gcc10/distinfo
diff -u pkgsrc/lang/gcc10/distinfo:1.12 pkgsrc/lang/gcc10/distinfo:1.13
--- pkgsrc/lang/gcc10/distinfo:1.12     Tue Oct 26 10:51:35 2021
+++ pkgsrc/lang/gcc10/distinfo  Wed Feb  2 22:07:28 2022
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.12 2021/10/26 10:51:35 nia Exp $
+$NetBSD: distinfo,v 1.13 2022/02/02 22:07:28 mrg Exp $
 
 BLAKE2s (gcc-10.3.0.tar.xz) = 6d7c42f9386e5e32a3148122471cb207e5f65d7b5f53b3c9adba2d45a4f28715
 SHA512 (gcc-10.3.0.tar.xz) = 2b2dd7453d48a398c29eaebd1422b70341001b8c90a62aee51e83344e7fdd8a8e45f82a4a9165bd7edc76dada912c932f4b6632c5636760fec4c5d7e402b3f86
@@ -9,11 +9,16 @@ Size (isl-0.16.1.tar.bz2) = 1626446 byte
 SHA1 (patch-contrib_download__prerequisites) = 9cdcde21ab174052911447d20762ddfd40aa8791
 SHA1 (patch-fixincludes_inclhack.def) = 7b00974d3f52a8364190a607f52a5d7e8a6db41a
 SHA1 (patch-gcc_Makefile.in) = c0f97c75ba1d37eae894141edd58bb36b734f651
-SHA1 (patch-gcc_config.gcc) = 4bf07441b6893e9b510f9ad775b4b95aa23e9791
+SHA1 (patch-gcc_config.gcc) = 310b306e58a1a3ec11b5081c6b8de5f75024e281
 SHA1 (patch-gcc_config.host) = 8920ce841f6088b365c9b590e3ea9535bd880b40
 SHA1 (patch-gcc_config_aarch64_aarch64-builtins.c) = 87185f5c2e2dbe4195cb19fe6213d2d616d5519b
 SHA1 (patch-gcc_config_aarch64_aarch64-netbsd.h) = abf19e2445bce1773162bddef16cd7f41eb36827
 SHA1 (patch-gcc_config_aarch64_driver-aarch64.c) = 7e17b49924ddd9ff33d049d6539e4df77d14d3e5
+SHA1 (patch-gcc_config_arm_arm.h) = 9d554349869d67d6393552c33a7824f0dd53cb11
+SHA1 (patch-gcc_config_arm_bpabi.h) = 0b0de5ad95442e34397cb46739ef6e36048d6f45
+SHA1 (patch-gcc_config_arm_elf.h) = 57748157084319cb92d892f2ea5b2f3355567551
+SHA1 (patch-gcc_config_arm_netbsd-eabi.h) = 85eb89de6f2e64fac50251f06d7e4eab35903dae
+SHA1 (patch-gcc_config_arm_netbsd-elf.h) = 367d83c808fd7b5b1989d0490b532ad06b425b31
 SHA1 (patch-gcc_config_darwin-driver.c) = fd57dcca96ce5ddc330e7c7b3b811f64856d7611
 SHA1 (patch-gcc_config_sparc_sparc.c) = e9cb956f3769642bcd0ba4a477d16c73dea46014
 SHA1 (patch-gcc_configure) = 6a2d8eeeed2bf08c3c81291178e669dc91c913ce
@@ -23,7 +28,7 @@ SHA1 (patch-gcc_targhooks.c) = b28d8a969
 SHA1 (patch-isl_configure) = 5523c76d95b229b3cd25461b4c2b7af24bf2534e
 SHA1 (patch-libffi_configure) = 22006b20d7f655e2455a7ad613d676703b6c1ccc
 SHA1 (patch-libffi_testsuite_libffi.call_float2.c) = 27b84a11378fb648dfaad0c70abedd77a0a1c1a8
-SHA1 (patch-libgcc_config.host) = ca62e9ecba9e6efe8b18dfb0d73a2ea47a818bec
+SHA1 (patch-libgcc_config.host) = d40d4d08c807eeff98cc246d1ea756b5b2c749b0
 SHA1 (patch-libgcc_crtstuff.c) = a16d465039de00c195cf0694560140a9c38f3a25
 SHA1 (patch-libgfortran_io_format.c) = 9bbc5e4f6277bdec785b3690fd08259939a2aa1a
 SHA1 (patch-libgfortran_io_io.h) = d44676239a7f45e42054d24bd5224f43c20055c0

Index: pkgsrc/lang/gcc10/patches/patch-gcc_config.gcc
diff -u pkgsrc/lang/gcc10/patches/patch-gcc_config.gcc:1.2 pkgsrc/lang/gcc10/patches/patch-gcc_config.gcc:1.3
--- pkgsrc/lang/gcc10/patches/patch-gcc_config.gcc:1.2  Thu Sep 23 09:53:21 2021
+++ pkgsrc/lang/gcc10/patches/patch-gcc_config.gcc      Wed Feb  2 22:07:28 2022
@@ -1,13 +1,13 @@
-$NetBSD: patch-gcc_config.gcc,v 1.2 2021/09/23 09:53:21 adam Exp $
+$NetBSD: patch-gcc_config.gcc,v 1.3 2022/02/02 22:07:28 mrg Exp $
 
 Match what is in NetBSD src. Fixes at least aarch64eb, and
 probably several others.
 
 Allow builds on Darwin 21.
 
---- gcc/config.gcc.orig        2021-04-08 11:56:28.000000000 +0000
-+++ gcc/config.gcc
-@@ -462,6 +462,16 @@ m32r*-*-*)
+--- gcc/config.gcc.orig        2021-04-08 04:56:28.033740243 -0700
++++ gcc/config.gcc     2022-02-02 10:27:44.252878051 -0800
+@@ -462,6 +462,16 @@
          cpu_type=m32r
        extra_options="${extra_options} g.opt"
          ;;
@@ -24,7 +24,7 @@ Allow builds on Darwin 21.
  m68k-*-*)
        extra_headers=math-68881.h
        extra_options="${extra_options} m68k/m68k-tables.opt"
-@@ -691,7 +701,7 @@ case ${target} in
+@@ -691,7 +701,7 @@
        *-*-darwin[4-9]* | *-*-darwin1[0-9]*)
          macos_min=`expr $darwin_maj - 4`
          ;;
@@ -33,7 +33,7 @@ Allow builds on Darwin 21.
          # Darwin 20 corresponds to macOS 11.
          macos_maj=11
          def_ld64=609.0
-@@ -877,6 +887,11 @@ case ${target} in
+@@ -877,6 +887,11 @@
    case ${enable_threads} in
      "" | yes | posix) thread_file='posix' ;;
    esac
@@ -45,7 +45,7 @@ Allow builds on Darwin 21.
    nbsd_tm_file="netbsd.h netbsd-stdint.h netbsd-elf.h"
    default_use_cxa_atexit=yes
    target_has_targetdm=yes
-@@ -1111,6 +1126,11 @@ aarch64*-*-netbsd*)
+@@ -1111,6 +1126,11 @@
        tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-netbsd.h"
        tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-netbsd"
        extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
@@ -57,7 +57,7 @@ Allow builds on Darwin 21.
        ;;
  aarch64*-*-linux*)
        tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
-@@ -1252,7 +1272,6 @@ arm*-*-freebsd*)                # ARM Fr
+@@ -1252,7 +1272,6 @@
        with_tls=${with_tls:-gnu}
        ;;
  arm*-*-netbsdelf*)
@@ -65,18 +65,19 @@ Allow builds on Darwin 21.
        tmake_file="${tmake_file} arm/t-arm"
        tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h"
        extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
-@@ -1261,26 +1280,33 @@ arm*-*-netbsdelf*)
+@@ -1261,26 +1280,34 @@
        esac
        case ${target} in
        arm*-*-netbsdelf-*eabi*)
 -          tm_file="$tm_file arm/bpabi.h arm/netbsd-elf.h arm/netbsd-eabi.h"
 -          tmake_file="$tmake_file arm/t-bpabi arm/t-netbsdeabi"
 +          tm_file="${tm_file} arm/bpabi.h arm/netbsd-elf.h arm/netbsd-eabi.h"
-+          # GCC 7 vs NetBSD/eabi -> avoid arm unwinder
 +          #tmake_file="$tmake_file arm/t-bpabi"
-+          tmake_file="$tmake_file arm/t-netbsdeabi"
 +          # The EABI requires the use of __cxa_atexit.
 +          default_use_cxa_atexit=yes
++          # NetBSD native configuration pulls this in, not sure why this must
++          # be here explicitly for pkgsrc.
++          gcc_cv_initfini_array=yes
            ;;
        *)
 -          tm_file="$tm_file arm/netbsd-elf.h"
@@ -106,7 +107,7 @@ Allow builds on Darwin 21.
        ;;
  arm*-*-linux-* | arm*-*-uclinuxfdpiceabi)
        tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
-@@ -1928,6 +1954,7 @@ i[34567]86-*-netbsdelf*)
+@@ -1928,6 +1955,7 @@
        ;;
  x86_64-*-netbsd*)
        tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/x86-64.h i386/netbsd64.h"
@@ -114,7 +115,7 @@ Allow builds on Darwin 21.
        extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
        ;;
  i[34567]86-*-openbsd*)
-@@ -2250,6 +2277,16 @@ ia64*-*-elf*)
+@@ -2250,6 +2278,16 @@
                target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
        fi
        ;;
@@ -131,7 +132,7 @@ Allow builds on Darwin 21.
  ia64*-*-freebsd*)
        tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} ia64/sysv4.h ia64/freebsd.h"
        target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
-@@ -2362,8 +2399,25 @@ m68k-*-elf* | fido-*-elf*)
+@@ -2362,8 +2400,25 @@
                ;;
        esac
        ;;
@@ -158,7 +159,7 @@ Allow builds on Darwin 21.
        default_cf_cpu=5475
        tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} m68k/netbsd-elf.h"
        extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
-@@ -2503,6 +2557,26 @@ riscv*-*-freebsd*)
+@@ -2503,6 +2558,26 @@
        # automatically detect that GAS supports it, yet we require it.
        gcc_cv_initfini_array=yes
        ;;
@@ -185,7 +186,7 @@ Allow builds on Darwin 21.
  mips*-*-netbsd*)                      # NetBSD/mips, either endian.
        target_cpu_default="MASK_ABICALLS"
        tm_file="elfos.h ${tm_file} mips/elf.h ${nbsd_tm_file} mips/netbsd.h"
-@@ -2918,11 +2992,24 @@ powerpc*-*-freebsd*)
+@@ -2918,11 +2993,24 @@
                ;;
        esac
        ;;
@@ -214,7 +215,7 @@ Allow builds on Darwin 21.
        ;;
  powerpc-*-eabisimaltivec*)
        tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h rs6000/eabialtivec.h"
-@@ -3394,9 +3481,11 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*
+@@ -3394,9 +3482,11 @@
  sparc64-*-netbsd*)
        tm_file="sparc/biarch64.h ${tm_file}"
        tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
@@ -226,7 +227,7 @@ Allow builds on Darwin 21.
        ;;
  sparc64-*-openbsd*)
        tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h"
-@@ -3911,6 +4000,9 @@ if test x$with_cpu = x ; then
+@@ -3911,6 +4001,9 @@
      frv550-*-*linux*)
        with_cpu=fr550
        ;;
@@ -236,7 +237,7 @@ Allow builds on Darwin 21.
      m68k*-*-*)
        case "$with_arch" in
        "cf")
-@@ -4421,7 +4513,7 @@ case "${target}" in
+@@ -4421,7 +4514,7 @@
                esac
                ;;
  

Index: pkgsrc/lang/gcc10/patches/patch-libgcc_config.host
diff -u pkgsrc/lang/gcc10/patches/patch-libgcc_config.host:1.1 pkgsrc/lang/gcc10/patches/patch-libgcc_config.host:1.2
--- pkgsrc/lang/gcc10/patches/patch-libgcc_config.host:1.1      Tue Oct 20 18:37:37 2020
+++ pkgsrc/lang/gcc10/patches/patch-libgcc_config.host  Wed Feb  2 22:07:28 2022
@@ -1,11 +1,11 @@
-$NetBSD: patch-libgcc_config.host,v 1.1 2020/10/20 18:37:37 tnn Exp $
+$NetBSD: patch-libgcc_config.host,v 1.2 2022/02/02 22:07:28 mrg Exp $
 
-This is needed to get Out-of-line LSE atomics linked into libgcc.
-libsupc++ fails to link without this.
+This is needed for arm64 to get Out-of-line LSE atomics linked into libgcc.
+libsupc++ fails to link without this, and for arm to build.
 
---- libgcc/config.host.orig    2020-07-23 06:35:18.752400064 +0000
-+++ libgcc/config.host
-@@ -377,6 +377,7 @@ aarch64*-*-freebsd*)
+--- libgcc/config.host.orig    2021-04-08 04:56:29.805761640 -0700
++++ libgcc/config.host 2022-02-02 04:08:51.653635705 -0800
+@@ -377,6 +377,7 @@
  aarch64*-*-netbsd*)
        extra_parts="$extra_parts crtfastmath.o"
        tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
@@ -13,3 +13,13 @@ libsupc++ fails to link without this.
        tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
        md_unwind_header=aarch64/aarch64-unwind.h
        ;;
+@@ -463,7 +464,8 @@
+       case ${host} in
+         arm*-*-netbsdelf-*eabi*)
+           tmake_file="${tmake_file} arm/t-netbsd-eabi"
+-          unwind_header=config/arm/unwind-arm.h
++          # GCC 7 vs NetBSD/eabi -> avoid arm unwinder
++          #unwind_header=config/arm/unwind-arm.h
+           ;;
+         *)
+           tmake_file="${tmake_file} arm/t-netbsd t-slibgcc-gld-nover"

Added files:

Index: pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_arm.h
diff -u /dev/null pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_arm.h:1.1
--- /dev/null   Wed Feb  2 22:07:28 2022
+++ pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_arm.h        Wed Feb  2 22:07:28 2022
@@ -0,0 +1,45 @@
+$NetBSD: patch-gcc_config_arm_arm.h,v 1.1 2022/02/02 22:07:28 mrg Exp $
+
+--- gcc/config/arm/arm.h.orig  2021-04-08 04:56:28.057740534 -0700
++++ gcc/config/arm/arm.h       2022-01-31 21:11:39.595024008 -0800
+@@ -937,6 +937,11 @@
+ #define ARM_UNWIND_INFO  0
+ #endif
+ 
++/* Overriden by config/arm/netbsd-eabi.h.  */
++#ifndef ARM_DWARF_UNWIND_TABLES
++#define ARM_DWARF_UNWIND_TABLES 0
++#endif
++
+ /* Use r0 and r1 to pass exception handling information.  */
+ #define EH_RETURN_DATA_REGNO(N) (((N) < 2) ? N : INVALID_REGNUM)
+ 
+@@ -948,11 +953,19 @@
+ #define ARM_TARGET2_DWARF_FORMAT DW_EH_PE_pcrel
+ #endif
+ 
++#if ARM_DWARF_UNWIND_TABLES
++/* DWARF unwinding uses the normal indirect/pcrel vs absptr format
++   for 32bit platforms. */
++#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
++  (flag_pic ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
++            : DW_EH_PE_absptr)
++#else
+ /* ttype entries (the only interesting data references used)
+    use TARGET2 relocations.  */
+ #define ASM_PREFERRED_EH_DATA_FORMAT(code, data) \
+   (((code) == 0 && (data) == 1 && ARM_UNWIND_INFO) ? ARM_TARGET2_DWARF_FORMAT \
+                              : DW_EH_PE_absptr)
++#endif
+ 
+ /* The native (Norcroft) Pascal compiler for the ARM passes the static chain
+    as an invisible last argument (possible since varargs don't exist in
+@@ -2342,7 +2355,7 @@
+ 
+ /* -mcpu=native handling only makes sense with compiler running on
+    an ARM chip.  */
+-#if defined(__arm__)
++#if defined(__arm__) && defined(__linux__)
+ extern const char *host_detect_local_cpu (int argc, const char **argv);
+ #define HAVE_LOCAL_CPU_DETECT
+ # define MCPU_MTUNE_NATIVE_FUNCTIONS                  \
Index: pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_bpabi.h
diff -u /dev/null pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_bpabi.h:1.1
--- /dev/null   Wed Feb  2 22:07:28 2022
+++ pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_bpabi.h      Wed Feb  2 22:07:28 2022
@@ -0,0 +1,22 @@
+$NetBSD: patch-gcc_config_arm_bpabi.h,v 1.1 2022/02/02 22:07:28 mrg Exp $
+
+--- gcc/config/arm/bpabi.h.orig        2021-04-08 04:56:28.061740583 -0700
++++ gcc/config/arm/bpabi.h     2022-01-31 21:13:16.734263818 -0800
+@@ -24,6 +24,7 @@
+    <http://www.gnu.org/licenses/>.  */
+ 
+ /* Use the AAPCS ABI by default.  */
++#undef ARM_DEFAULT_ABI
+ #define ARM_DEFAULT_ABI ARM_ABI_AAPCS
+ 
+ /* Assume that AAPCS ABIs should adhere to the full BPABI.  */
+@@ -107,7 +108,9 @@
+ /* The BPABI specifies the use of .{init,fini}_array.  Therefore, we
+    do not want GCC to put anything into the .{init,fini} sections.  */
+ #undef INIT_SECTION_ASM_OP
++#define INIT_SECTION_ASM_OP ""
+ #undef FINI_SECTION_ASM_OP
++#define FINI_SECTION_ASM_OP ""
+ #define INIT_ARRAY_SECTION_ASM_OP ARM_EABI_CTORS_SECTION_OP
+ #define FINI_ARRAY_SECTION_ASM_OP ARM_EABI_DTORS_SECTION_OP
+ 
Index: pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_elf.h
diff -u /dev/null pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_elf.h:1.1
--- /dev/null   Wed Feb  2 22:07:28 2022
+++ pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_elf.h        Wed Feb  2 22:07:28 2022
@@ -0,0 +1,14 @@
+$NetBSD: patch-gcc_config_arm_elf.h,v 1.1 2022/02/02 22:07:28 mrg Exp $
+
+--- gcc/config/arm/elf.h.orig  2021-04-08 04:56:28.065740630 -0700
++++ gcc/config/arm/elf.h       2022-01-31 21:14:04.684223580 -0800
+@@ -147,6 +147,8 @@
+ #undef L_floatdidf
+ #undef L_floatdisf
+ #undef L_floatundidf
++/* XXXMRG: don't take this out, we need it! */
++# ifndef __NetBSD__
+ #undef L_floatundisf
++# endif
+ #endif
+-
Index: pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_netbsd-eabi.h
diff -u /dev/null pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_netbsd-eabi.h:1.1
--- /dev/null   Wed Feb  2 22:07:28 2022
+++ pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_netbsd-eabi.h        Wed Feb  2 22:07:28 2022
@@ -0,0 +1,57 @@
+$NetBSD: patch-gcc_config_arm_netbsd-eabi.h,v 1.1 2022/02/02 22:07:28 mrg Exp $
+
+--- gcc/config/arm/netbsd-eabi.h.orig  2021-04-08 04:56:28.065740630 -0700
++++ gcc/config/arm/netbsd-eabi.h       2022-01-31 21:15:29.555403989 -0800
+@@ -49,8 +49,8 @@
+ 
+ #undef ARM_UNWIND_INFO
+ #define ARM_UNWIND_INFO 0
+-#undef DWARF2_UNWIND_INFO
+-#define DWARF2_UNWIND_INFO 1
++#undef ARM_DWARF_UNWIND_TABLES
++#define ARM_DWARF_UNWIND_TABLES 1
+ 
+ #undef TARGET_OS_CPP_BUILTINS
+ #define TARGET_OS_CPP_BUILTINS()              \
+@@ -59,7 +59,7 @@
+       if (TARGET_AAPCS_BASED)                 \
+       TARGET_BPABI_CPP_BUILTINS();            \
+       NETBSD_OS_CPP_BUILTINS_ELF();           \
+-      if (DWARF2_UNWIND_INFO)                 \
++      if (ARM_DWARF_UNWIND_TABLES)            \
+       builtin_define ("__ARM_DWARF_EH__");    \
+     }                                         \
+   while (0)
+@@ -81,17 +81,25 @@
+ 
+ #undef SUBTARGET_EXTRA_ASM_SPEC
+ #define SUBTARGET_EXTRA_ASM_SPEC              \
+-  "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu} "   \
++  "-matpcs %{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu} "   \
+   "%{fpic|fpie:-k} "                          \
+   "%{fPIC|fPIE:-k}"
+ 
++/* Default to full VFP if -mhard-float is specified.  */
++#undef SUBTARGET_ASM_FLOAT_SPEC
++#define SUBTARGET_ASM_FLOAT_SPEC      \
++  "%{mhard-float:%{!mfpu=*:-mfpu=vfp}}   \
++   %{mfloat-abi=hard:%{!mfpu=*:-mfpu=vfp}}"
++
+ #undef SUBTARGET_EXTRA_SPECS
+ #define SUBTARGET_EXTRA_SPECS                                         \
+   { "subtarget_extra_asm_spec",       SUBTARGET_EXTRA_ASM_SPEC },             \
++  { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC },           \
+   { "linker_eabi_suffix",     TARGET_LINKER_EABI_SUFFIX },            \
+   { "linker_emulation",               TARGET_LINKER_EMULATION },              \
+   { "linker_big_emulation",   TARGET_LINKER_BIG_EMULATION },          \
+   { "linker_little_emulation",        TARGET_LINKER_LITTLE_EMULATION },       \
++  { "be8_link_spec",          BE8_LINK_SPEC },                        \
+   { "target_fix_v4bx_spec",   TARGET_FIX_V4BX_SPEC },                 \
+   NETBSD_SUBTARGET_EXTRA_SPECS
+ 
+@@ -102,4 +110,5 @@
+   "-X %{mbig-endian:-EB -m %(linker_big_emulation)} "         \
+   "%{mlittle-endian:-EL -m %(linker_liitle_emulation)} "      \
+   "%{!mbig-endian:%{!mlittle-endian:-m %(linker_emulation)}} "        \
++  "%(be8_link_spec) "                                         \
+   "%(target_fix_v4bx_spec) %(netbsd_link_spec)"
Index: pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_netbsd-elf.h
diff -u /dev/null pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_netbsd-elf.h:1.1
--- /dev/null   Wed Feb  2 22:07:28 2022
+++ pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_netbsd-elf.h Wed Feb  2 22:07:28 2022
@@ -0,0 +1,80 @@
+$NetBSD: patch-gcc_config_arm_netbsd-elf.h,v 1.1 2022/02/02 22:07:28 mrg Exp $
+
+--- gcc/config/arm/netbsd-elf.h.orig   2021-04-08 04:56:28.065740630 -0700
++++ gcc/config/arm/netbsd-elf.h        2022-01-31 21:14:32.314234515 -0800
+@@ -27,9 +27,20 @@
+ 
+ /* arm.h defaults to ARM6 CPU.  */
+ 
+-/* This defaults us to little-endian.  */
+-#ifndef TARGET_ENDIAN_DEFAULT
+-#define TARGET_ENDIAN_DEFAULT 0
++/* Default EABI to armv5t so that thumb shared libraries work.
++   The ARM926EH-S core is the default for armv5te, so set
++   SUBTARGET_CPU_DEFAULT to achieve this.  */
++
++#define SUBTARGET_CPU_DEFAULT \
++      (ARM_DEFAULT_ABI != ARM_ABI_APCS && ARM_DEFAULT_ABI != ARM_ABI_ATPCS \
++          ? TARGET_CPU_arm926ejs : TARGET_CPU_arm6)
++
++/* TARGET_BIG_ENDIAN_DEFAULT is set in
++   config.gcc for big endian configurations.  */
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_ENDIAN_DEFAULT    MASK_BIG_END
++#else
++#define TARGET_ENDIAN_DEFAULT    0
+ #endif
+ 
+ #undef MULTILIB_DEFAULTS
+@@ -56,25 +67,28 @@
+ 
+ #undef SUBTARGET_EXTRA_ASM_SPEC
+ #define SUBTARGET_EXTRA_ASM_SPEC      \
++  "-matpcs %{mabi=aapcs*:-meabi=5} "  \
+   "%{" FPIE_OR_FPIC_SPEC ":-k}"
+ 
++#undef SUBTARGET_EXTRA_SPECS
++#define SUBTARGET_EXTRA_SPECS                                 \
++  { "subtarget_extra_asm_spec",       SUBTARGET_EXTRA_ASM_SPEC },     \
++  { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC },   \
++  NETBSD_SUBTARGET_EXTRA_SPECS
++
+ /* Default to full VFP if -mfloat-abi=hard is specified.  */
+ #undef SUBTARGET_ASM_FLOAT_SPEC
+-#define SUBTARGET_ASM_FLOAT_SPEC      \
+-  "%{mfloat-abi=hard:{!mfpu=*:-mfpu=vfp}}"
+-
+-#undef SUBTARGET_EXTRA_SPECS
+-#define SUBTARGET_EXTRA_SPECS                         \
+-  { "subtarget_extra_asm_spec",       SUBTARGET_EXTRA_ASM_SPEC }, \
+-  { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \
+-  { "netbsd_link_spec",               NETBSD_LINK_SPEC_ELF }, \
+-  { "netbsd_entry_point",     NETBSD_ENTRY_POINT },
++#define SUBTARGET_ASM_FLOAT_SPEC              \
++  "%{mhard-float:%{!mfpu=*:-mfpu=vfp}}                \
++   %{mfloat-abi=hard:%{!mfpu=*:-mfpu=vfp}}"
+ 
+ #define NETBSD_ENTRY_POINT "__start"
+ 
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+-  "-X %{mbig-endian:-EB} %{mlittle-endian:-EL} \
++  "-X \
++   %{mbig-endian:-EB %{-mabi=aapcs*:-m armelfb_nbsd_eabi}} \
++   %{mlittle-endian:-EL %{-mabi=aapcs*:-m armelf_nbsd_eabi}} \
+    %(netbsd_link_spec)"
+ 
+ /* Make GCC agree with <machine/ansi.h>.  */
+@@ -85,6 +99,12 @@
+ #undef PTRDIFF_TYPE
+ #define PTRDIFF_TYPE "long int"
+ 
++#undef INTPTR_TYPE
++#define INTPTR_TYPE PTRDIFF_TYPE
++
++#undef UINTPTR_TYPE
++#define UINTPTR_TYPE SIZE_TYPE
++
+ /* We don't have any limit on the length as out debugger is GDB.  */
+ #undef DBX_CONTIN_LENGTH
+ 



Home | Main Index | Thread Index | Old Index