pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang gcc7: fix many netbsd targets.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4b2980c1fd42
branches:  trunk
changeset: 381840:4b2980c1fd42
user:      maya <maya%pkgsrc.org@localhost>
date:      Sun Jun 17 19:50:52 2018 +0000

description:
gcc7: fix many netbsd targets.

add netbsd/arm EABI target. recognise dwarf2 unwinding in the common arm code.

switch convoluted stddef.h logic from relying on include guards having certain
names to only applying for netbsd, which should be the sole remaining user.
(necessary for netbsd/arm, which uses different include guards for ansi.h)

move linux/alpha code out of shared alpha+ELF header.

make all netbsd targets include netbsd-stdint.h.

Fixes PR pkg/52951.

Bump PKGREVISION. bump gcc7-libs PKGREVISION above this one.

diffstat:

 lang/gcc7-libs/Makefile                                    |    4 +-
 lang/gcc7/Makefile                                         |    4 +-
 lang/gcc7/distinfo                                         |   14 +-
 lang/gcc7/patches/patch-gcc_common_config_arm_arm-common.c |   16 +
 lang/gcc7/patches/patch-gcc_config.gcc                     |  115 ++++++++++++-
 lang/gcc7/patches/patch-gcc_config_alpha_elf.h             |   40 ++++
 lang/gcc7/patches/patch-gcc_config_alpha_linux.h           |   40 ++++
 lang/gcc7/patches/patch-gcc_config_arm_netbsd-eabi.h       |  119 +++++++++++++
 lang/gcc7/patches/patch-gcc_config_arm_netbsd-elf.h        |   96 ++++++++++
 lang/gcc7/patches/patch-gcc_config_netbsd-elf.h            |   34 +++
 lang/gcc7/patches/patch-gcc_ginclude_stddef.h              |   62 ++++++
 lang/gcc7/patches/patch-libgcc_config.host                 |   24 ++
 lang/gcc7/patches/patch-libgcc_config_arm_t-netbsd         |   27 ++
 lang/gcc7/patches/patch-libgcc_config_arm_t-netbsd-eabi    |   26 ++
 14 files changed, 610 insertions(+), 11 deletions(-)

diffs (truncated from 740 to 300 lines):

diff -r cfd1ae77ff42 -r 4b2980c1fd42 lang/gcc7-libs/Makefile
--- a/lang/gcc7-libs/Makefile   Sun Jun 17 19:32:21 2018 +0000
+++ b/lang/gcc7-libs/Makefile   Sun Jun 17 19:50:52 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2018/05/21 10:05:58 jperkin Exp $
+# $NetBSD: Makefile,v 1.2 2018/06/17 19:50:52 maya Exp $
 
 GCC_PKGNAME=   gcc7
 .include       "../../lang/${GCC_PKGNAME}/version.mk"
@@ -9,7 +9,7 @@
 ## The PKGREVISION of this package needs to be at least 1 more than the
 ## PKGREVISION of the lang/gcc7 package so that with the dependence pattern
 ## '{gcc7,gcc7-libs}>=7.3.*' pkg_add will choose gcc7-libs over gcc7.
-PKGREVISION=   2
+PKGREVISION=   3
 
 CATEGORIES=    lang
 MASTER_SITES=  # empty
diff -r cfd1ae77ff42 -r 4b2980c1fd42 lang/gcc7/Makefile
--- a/lang/gcc7/Makefile        Sun Jun 17 19:32:21 2018 +0000
+++ b/lang/gcc7/Makefile        Sun Jun 17 19:50:52 2018 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.17 2018/05/23 08:11:16 jperkin Exp $
+# $NetBSD: Makefile,v 1.18 2018/06/17 19:50:52 maya Exp $
 
 GCC_PKGNAME=           gcc7
-PKGREVISION=           1
+PKGREVISION=           2
 .include               "version.mk"
 
 DISTNAME=      gcc-${GCC7_DIST_VERSION}
diff -r cfd1ae77ff42 -r 4b2980c1fd42 lang/gcc7/distinfo
--- a/lang/gcc7/distinfo        Sun Jun 17 19:32:21 2018 +0000
+++ b/lang/gcc7/distinfo        Sun Jun 17 19:50:52 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.9 2018/05/23 08:11:16 jperkin Exp $
+$NetBSD: distinfo,v 1.10 2018/06/17 19:50:52 maya Exp $
 
 SHA1 (gcc-7.3.0.tar.xz) = 9689b9cae7b2886fdaa08449a26701f095c04e48
 RMD160 (gcc-7.3.0.tar.xz) = 31f6934a0e0c0ca84b6668110f9afdb91c1f9023
@@ -10,14 +10,21 @@
 Size (isl-0.16.1.tar.bz2) = 1626446 bytes
 SHA1 (patch-contrib_download__prerequisites) = 86c6c16e0e3e3a0bcb38579a8b4004f603fac1ca
 SHA1 (patch-gcc_Makefile.in) = d96a57a098e49a2c5ea6478dd5d22aba584fc1bc
-SHA1 (patch-gcc_config.gcc) = 943797cbbdbf25885b4f16a1a027d137ef68357e
+SHA1 (patch-gcc_common_config_arm_arm-common.c) = 7c973cb9554a52f4b85f8fc98708f5e5cce8e8bd
+SHA1 (patch-gcc_config.gcc) = fd19774e62c2931d52eda2f979c1db65202ed4fb
+SHA1 (patch-gcc_config_alpha_elf.h) = 05657c528109480296cbe8a98461cba7853af492
+SHA1 (patch-gcc_config_alpha_linux.h) = fce1256bce232143ff6c1c1b8b9c855737adb23f
 SHA1 (patch-gcc_config_arm_arm.h) = 92c8bff1063e153fec4454e6dea5334a42b0dad6
+SHA1 (patch-gcc_config_arm_netbsd-eabi.h) = 9c1d2148e306024e8de3bdc9802fb63b976e0e7a
+SHA1 (patch-gcc_config_arm_netbsd-elf.h) = 80a07645fab197969b4a6f518fdc81bda7376375
+SHA1 (patch-gcc_config_netbsd-elf.h) = 5a9b5ef26c03bec3cd58e2f446224aa6e94a30d5
 SHA1 (patch-gcc_config_netbsd-protos.h) = 6d28864b4ccc8c1a63fe28e43601b84b63a00633
 SHA1 (patch-gcc_config_netbsd.h) = 8861abb345b3ad72574fbe7afca2ea78b81d9632
 SHA1 (patch-gcc_config_t-netbsd) = 802ad5706aa7ca9629f8e237f08fbb1569d28846
 SHA1 (patch-gcc_config_x-netbsd) = 6dc3d78e26df62054ea29f98ca51592858e671e3
 SHA1 (patch-gcc_configure) = 15fb7af267b79965f83bc64ce8aad1279b0ea52d
 SHA1 (patch-gcc_ggc-common.c) = a5d2dba635859f5d680c3f80d7c30b42461c752b
+SHA1 (patch-gcc_ginclude_stddef.h) = 583b7931aad14058be75569b0138efad8ac74113
 SHA1 (patch-gcc_lto_lto.c) = 825b632e2a7ff5777d4fbfdcf6f0ea3f64c4742b
 SHA1 (patch-gcc_system.h) = 4c959a6b1c4d524cbdf44cfb80f0e5758ec20783
 SHA1 (patch-isl_configure) = 36b37778ee13c0b364fb24d5864d6a9e65b29b7d
@@ -26,6 +33,9 @@
 SHA1 (patch-libdecnumber_decNumber.c) = cec90e49c829bfc6ba1ec605d2fac7daaad62762
 SHA1 (patch-libffi_configure) = bcfbfe8abddc378e2de4a39ad0669583b37e0292
 SHA1 (patch-libffi_testsuite_libffi.call_float2.c) = 6321dde308579448c27c2b6e1e30633699dd145f
+SHA1 (patch-libgcc_config.host) = 1c2ebce3a44d935e9bbab30952b51b6f3716e47e
+SHA1 (patch-libgcc_config_arm_t-netbsd) = fe986b09ccbfc253aaaca263e8e38f06da4891cc
+SHA1 (patch-libgcc_config_arm_t-netbsd-eabi) = 1e818e92fe79f57d305ff42ce3449dddf87c3179
 SHA1 (patch-libgcc_config_i386_cpuinfo.h) = d217e3c65178c96c7314cb88c740b9586d4e8fed
 SHA1 (patch-libgcc_crtstuff.c) = e3a3b02a26229992851f195b5701cb1b86c29efe
 SHA1 (patch-libgfortran_configure) = 869a60fd08edecf18a42732dcbf226bad1309394
diff -r cfd1ae77ff42 -r 4b2980c1fd42 lang/gcc7/patches/patch-gcc_common_config_arm_arm-common.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc7/patches/patch-gcc_common_config_arm_arm-common.c        Sun Jun 17 19:50:52 2018 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-gcc_common_config_arm_arm-common.c,v 1.1 2018/06/17 19:50:52 maya Exp $
+
+use dwarf2 if requested, netbsd/arm uses this.
+
+--- gcc/common/config/arm/arm-common.c.orig    2017-01-11 14:39:00.884692000 +0000
++++ gcc/common/config/arm/arm-common.c
+@@ -49,6 +49,9 @@ arm_except_unwind_info (struct gcc_optio
+     return UI_SJLJ;
+ #endif
+ 
++  if (ARM_DWARF_UNWIND_TABLES)
++    return UI_DWARF2;
++
+   /* If not using ARM EABI unwind tables... */
+   if (ARM_UNWIND_INFO)
+     {
diff -r cfd1ae77ff42 -r 4b2980c1fd42 lang/gcc7/patches/patch-gcc_config.gcc
--- a/lang/gcc7/patches/patch-gcc_config.gcc    Sun Jun 17 19:32:21 2018 +0000
+++ b/lang/gcc7/patches/patch-gcc_config.gcc    Sun Jun 17 19:50:52 2018 +0000
@@ -1,10 +1,14 @@
-$NetBSD: patch-gcc_config.gcc,v 1.2 2018/01/25 23:27:30 maya Exp $
+$NetBSD: patch-gcc_config.gcc,v 1.3 2018/06/17 19:50:52 maya Exp $
 
 Workaround netbsd's compatibility non-C99 cabs (causes gfortran link failures)
+netbsd/arm eabi support
+
+use nbsd_tm_file to make sure every netbsd target gets netbsd-stdint.h
+(upstreamed)
 
 --- gcc/config.gcc.orig        2018-01-08 13:39:11.000000000 +0000
 +++ gcc/config.gcc
-@@ -781,6 +781,10 @@ case ${target} in
+@@ -781,7 +781,12 @@ case ${target} in
    gas=yes
    gnu_ld=yes
    use_gcc_stdint=wrap
@@ -13,18 +17,119 @@
 +  target_gtfiles="${target_gtfiles} \$(srcdir)/config/netbsd.c"
 +  extra_objs="${extra_objs} netbsd.o"
  
++  nbsd_tm_file="netbsd.h netbsd-stdint.h netbsd-elf.h"
    # NetBSD 2.0 and later get POSIX threads enabled by default.
    # Allow them to be explicitly enabled on any other version.
-@@ -1487,10 +1491,12 @@ x86_64-*-freebsd*)
+   case ${enable_threads} in
+@@ -1001,7 +1006,7 @@ alpha*-*-freebsd*)
+       extra_options="${extra_options} alpha/elf.opt"
+       ;;
+ alpha*-*-netbsd*)
+-      tm_file="elfos.h ${tm_file} netbsd.h alpha/elf.h netbsd-elf.h alpha/netbsd.h"
++      tm_file="elfos.h ${tm_file} ${nbsd_tm_file} alpha/elf.h alpha/netbsd.h"
+       tmake_file="${tmake_file} alpha/t-alpha"
+       extra_options="${extra_options} netbsd.opt netbsd-elf.opt \
+                      alpha/elf.opt"
+@@ -1092,10 +1097,37 @@ arm*-*-freebsd*)                # ARM Fr
+       with_tls=${with_tls:-gnu}
+       ;;
+ arm*-*-netbsdelf*)
+-      tm_file="dbxelf.h elfos.h netbsd.h netbsd-elf.h arm/elf.h arm/aout.h ${tm_file} arm/netbsd-elf.h"
+-      extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+       tmake_file="${tmake_file} arm/t-arm"
+-      target_cpu_cname="arm6"
++      tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h"
++      extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
++      case ${target} in
++      arm*eb-*) tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" ;;
++      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"
++          # The BPABI long long divmod functions return a 128-bit value in
++          # registers r0-r3.  Correctly modeling that requires the use of
++          # TImode.
++          need_64bit_hwint=yes
++          ;;
++      *)
++          tm_file="$tm_file arm/netbsd-elf.h"
++          tmake_file="$tmake_file arm/t-netbsd"
++          ;;
++      esac
++      tm_file="${tm_file} arm/aout.h arm/arm.h"
++      case ${target} in
++      arm*-*-netbsdelf-*eabihf*)
++          tm_defines="${tm_defines} TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD"
++          ;;
++      esac
++      case ${target} in
++      armv4*) target_cpu_cname="strongarm";;
++      armv6*) target_cpu_cname="arm1176jzfs";;
++      armv7*) target_cpu_cname="cortexa8";;
++      esac
+       ;;
+ arm*-*-linux-*)                       # ARM GNU/Linux with ELF
+       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"
+@@ -1485,12 +1517,14 @@ x86_64-*-freebsd*)
+       tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
+       ;;
  i[34567]86-*-netbsdelf*)
-       tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-stdint.h netbsd-elf.h i386/netbsd-elf.h"
+-      tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-stdint.h netbsd-elf.h i386/netbsd-elf.h"
++      tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/netbsd-elf.h"
        extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
 +      tmake_file="${tmake_file} i386/t-crtstuff"
        ;;
  x86_64-*-netbsd*)
-       tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-stdint.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
+-      tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-stdint.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
++      tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/x86-64.h i386/netbsd64.h"
        extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
 +      tmake_file="${tmake_file} i386/t-crtstuff"
        ;;
  i[34567]86-*-openbsd*)
        tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
+@@ -2381,7 +2415,7 @@ powerpc*-*-freebsd*)
+       esac
+       ;;
+ powerpc-*-netbsd*)
+-      tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
++      tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
+       extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+       tmake_file="${tmake_file} rs6000/t-netbsd"
+       extra_options="${extra_options} rs6000/sysv4.opt"
+@@ -2700,7 +2734,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
+                       fi
+                       tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h sh/linux.h" ;;
+       sh*-*-netbsd*)
+-                      tm_file="${tm_file} netbsd.h netbsd-elf.h sh/netbsd-elf.h"
++                      tm_file="${tm_file} ${nbsd_tm_file} sh/netbsd-elf.h"
+                       extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+ 
+                       ;;
+@@ -2860,7 +2894,7 @@ sparc-*-linux*)
+       fi
+       ;;
+ sparc-*-netbsdelf*)
+-      tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
++      tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
+       extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+       extra_options="${extra_options} sparc/long-double-switch.opt"
+       tmake_file="${tmake_file} sparc/t-sparc"
+@@ -2908,7 +2942,7 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*
+       ;;
+ sparc64-*-netbsd*)
+       tm_file="sparc/biarch64.h ${tm_file}"
+-      tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
++      tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
+       extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+       extra_options="${extra_options} sparc/long-double-switch.opt"
+       tmake_file="${tmake_file} sparc/t-sparc sparc/t-netbsd64"
+@@ -3012,7 +3046,7 @@ vax-*-linux*)
+       extra_options="${extra_options} vax/elf.opt"
+       ;;
+ vax-*-netbsdelf*)
+-      tm_file="${tm_file} elfos.h netbsd.h netbsd-elf.h vax/elf.h vax/netbsd-elf.h"
++      tm_file="${tm_file} elfos.h ${nbsd_tm_file} vax/elf.h vax/netbsd-elf.h"
+       extra_options="${extra_options} netbsd.opt netbsd-elf.opt vax/elf.opt"
+       ;;
+ vax-*-openbsd*)
diff -r cfd1ae77ff42 -r 4b2980c1fd42 lang/gcc7/patches/patch-gcc_config_alpha_elf.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc7/patches/patch-gcc_config_alpha_elf.h    Sun Jun 17 19:50:52 2018 +0000
@@ -0,0 +1,40 @@
+$NetBSD: patch-gcc_config_alpha_elf.h,v 1.1 2018/06/17 19:50:52 maya Exp $
+
+Move linux-specific definitions to linux file.
+PR target/85095, https://gcc.gnu.org/ml/gcc-patches/2018-05/msg01370.html
+
+--- gcc/config/alpha/elf.h.orig        2017-01-01 12:07:43.905435000 +0000
++++ gcc/config/alpha/elf.h
+@@ -100,32 +100,6 @@ do {                                                                      \
+     ASM_OUTPUT_DEF (FILE, alias, name);                               \
+   } while (0)
+ 
+-/* Provide a STARTFILE_SPEC appropriate for ELF.  Here we add the
+-   (even more) magical crtbegin.o file which provides part of the
+-   support for getting C++ file-scope static object constructed
+-   before entering `main'.  */
+-
+-#undef        STARTFILE_SPEC
+-#ifdef HAVE_LD_PIE
+-#define STARTFILE_SPEC \
+-  "%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\
+-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+-#else
+-#define STARTFILE_SPEC \
+-  "%{!shared: %{pg|p:gcrt1.o%s;:crt1.o%s}}\
+-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+-#endif
+-
+-/* Provide a ENDFILE_SPEC appropriate for ELF.  Here we tack on the
+-   magical crtend.o file which provides part of the support for
+-   getting C++ file-scope static object constructed before entering
+-   `main', followed by a normal ELF "finalizer" file, `crtn.o'.  */
+-
+-#undef        ENDFILE_SPEC
+-#define ENDFILE_SPEC \
+-  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+-   %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+-
+ /* This variable should be set to 'true' if the target ABI requires
+    unwinding tables even when exceptions are not used.  */
+ #define TARGET_UNWIND_TABLES_DEFAULT true
diff -r cfd1ae77ff42 -r 4b2980c1fd42 lang/gcc7/patches/patch-gcc_config_alpha_linux.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc7/patches/patch-gcc_config_alpha_linux.h  Sun Jun 17 19:50:52 2018 +0000
@@ -0,0 +1,40 @@
+$NetBSD: patch-gcc_config_alpha_linux.h,v 1.1 2018/06/17 19:50:52 maya Exp $
+
+Move linux-specific definitions to linux file.
+PR target/85095, https://gcc.gnu.org/ml/gcc-patches/2018-05/msg01370.html
+
+--- gcc/config/alpha/linux.h.orig      2017-01-01 12:07:43.905435000 +0000
++++ gcc/config/alpha/linux.h
+@@ -78,6 +78,32 @@ along with GCC; see the file COPYING3.  
+ 
+ #define TARGET_POSIX_IO
+ 
++/* Provide a STARTFILE_SPEC appropriate for ELF.  Here we add the
++   (even more) magical crtbegin.o file which provides part of the
++   support for getting C++ file-scope static object constructed
++   before entering `main'.  */
++



Home | Main Index | Thread Index | Old Index