pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/g95 g95: Fix netbsd/mips64 builds



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d9869f604105
branches:  trunk
changeset: 364132:d9869f604105
user:      maya <maya%pkgsrc.org@localhost>
date:      Wed Jun 21 11:36:20 2017 +0000

description:
g95: Fix netbsd/mips64 builds

NetBSD switched to n32 ABI for mips64el in NetBSD 6, and the build is
failing due to the default ABI mismatch between linker and newly built
compiler.

Default to n32 and backport n32 size definitions from newer GCC.

Small chance of a functional change for o32 builds (which should work), ride
previous PKGREVISION bump for it.

diffstat:

 lang/g95/distinfo                               |   5 +-
 lang/g95/patches/patch-gcc_config.gcc           |  15 ++++-
 lang/g95/patches/patch-gcc_config_mips_netbsd.h |  71 +++++++++++++++++++++++++
 3 files changed, 88 insertions(+), 3 deletions(-)

diffs (129 lines):

diff -r ca58ce0c9991 -r d9869f604105 lang/g95/distinfo
--- a/lang/g95/distinfo Wed Jun 21 11:13:07 2017 +0000
+++ b/lang/g95/distinfo Wed Jun 21 11:36:20 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.29 2017/06/21 01:12:56 maya Exp $
+$NetBSD: distinfo,v 1.30 2017/06/21 11:36:20 maya Exp $
 
 SHA1 (g95_source.tgz) = b5e503fd6459b65cbda73190685f9490230d9cff
 RMD160 (g95_source.tgz) = 98d03e9a1835f4b3553a72a798bdf1d90a757176
@@ -12,12 +12,13 @@
 SHA1 (patch-configure) = 48450808201d4ea5ddb993627c4efeaf43d53bd2
 SHA1 (patch-g95spec.c) = d6f434e715835cd39511c45ed18632c8401b78a2
 SHA1 (patch-gcc_Makefile.in) = cc5cc142a85612ebf2d38513e4b05db0ae795268
-SHA1 (patch-gcc_config.gcc) = ed135c425730d231182e36af840278d307396c6e
+SHA1 (patch-gcc_config.gcc) = 41c7b8c86dc87032159126d33b33ae4d0265fb07
 SHA1 (patch-gcc_config_dragonfly-spec.h) = bf0c97caa314714542cf8cc63fdf0c73bda80511
 SHA1 (patch-gcc_config_dragonfly.h) = 6d46b7b4637a20b36e19a15e1eaffdfff6638de9
 SHA1 (patch-gcc_config_freebsd-spec.h) = 508304b26b592518c3d3f43f466ac0a6542b2704
 SHA1 (patch-gcc_config_i386_dragonfly.h) = 7d60d29b5ae636d69650e8c412a94f7a6045f6d9
 SHA1 (patch-gcc_config_i386_dragonfly64.h) = 9d2d8512a913e58055fa5c1b7d85a109117dcfba
+SHA1 (patch-gcc_config_mips_netbsd.h) = 8888ecaa470e38a82ec56e332658fd32c9e5e86c
 SHA1 (patch-gcc_config_rs600_netbsd.h) = 2e568e48f84024b7182762107c4ee76ee87fe43c
 SHA1 (patch-gcc_config_t-dragonfly) = dd8d5919af737dfb9e3c18be9a41b4e2c6f31155
 SHA1 (patch-gcc_config_t-dragonfly-thread) = ebdb58dacf0dc5d0bf2f1f1707a7c6ab29ee308c
diff -r ca58ce0c9991 -r d9869f604105 lang/g95/patches/patch-gcc_config.gcc
--- a/lang/g95/patches/patch-gcc_config.gcc     Wed Jun 21 11:13:07 2017 +0000
+++ b/lang/g95/patches/patch-gcc_config.gcc     Wed Jun 21 11:36:20 2017 +0000
@@ -1,8 +1,9 @@
-$NetBSD: patch-gcc_config.gcc,v 1.4 2016/09/27 20:51:11 maya Exp $
+$NetBSD: patch-gcc_config.gcc,v 1.5 2017/06/21 11:36:20 maya Exp $
 
 Darwin 64-bit support.
 DragonFly BSD support.
 FreeBSD 10 to 12 support.
+NetBSD/mips64 should default to n32 ABI
 
 --- ../gcc-4.1.2/gcc/config.gcc.orig   2006-10-15 23:12:23.000000000 +0000
 +++ ../gcc-4.1.2/gcc/config.gcc
@@ -65,3 +66,15 @@
  i[34567]86-*-netbsdelf*)
        tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h"
        ;;
+@@ -1473,6 +1504,11 @@ mips-sgi-irix[56]*)
+ #     fi
+       use_fixproto=yes
+       ;;
++mips64*-*-netbsd*)                    # NetBSD/mips64, either endian.
++      target_cpu_default="MASK_ABICALLS"
++      tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
++      tm_file="elfos.h ${tm_file} mips/elf.h netbsd.h netbsd-elf.h mips/netbsd.h"
++      ;;
+ mips*-*-netbsd*)                      # NetBSD/mips, either endian.
+       target_cpu_default="MASK_ABICALLS"
+       tm_file="elfos.h ${tm_file} mips/elf.h netbsd.h netbsd-elf.h mips/netbsd.h"
diff -r ca58ce0c9991 -r d9869f604105 lang/g95/patches/patch-gcc_config_mips_netbsd.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/g95/patches/patch-gcc_config_mips_netbsd.h   Wed Jun 21 11:36:20 2017 +0000
@@ -0,0 +1,71 @@
+$NetBSD: patch-gcc_config_mips_netbsd.h,v 1.1 2017/06/21 11:36:20 maya Exp $
+
+n32 support for netbsd/mips64
+
+--- ../gcc-4.1.2/gcc/config/mips/netbsd.h.orig 2005-06-25 01:22:41.000000000 +0000
++++ ../gcc-4.1.2/gcc/config/mips/netbsd.h
+@@ -39,18 +39,56 @@ Boston, MA 02110-1301, USA.  */
+       builtin_define ("__LONG64");                    \
+                                                       \
+       if (TARGET_ABICALLS)                            \
+-      builtin_define ("__ABICALLS__");                \
++      builtin_define ("__mips_abicalls");             \
+                                                       \
+-      if (mips_abi == ABI_EABI)                               \
+-      builtin_define ("__mips_eabi");                 \
+-      else if (mips_abi == ABI_N32)                   \
+-      builtin_define ("__mips_n32");                  \
++    if (mips_abi == ABI_N32)                          \
++      {                                                       \
++        builtin_define ("_ABIN32=2");                 \
++        builtin_define ("_MIPS_SIM=_ABIN32");         \
++        builtin_define ("_MIPS_SZLONG=32");           \
++        builtin_define ("_MIPS_SZPTR=32");            \
++      }                                                       \
+       else if (mips_abi == ABI_64)                    \
+-      builtin_define ("__mips_n64");                  \
++      {                                                       \
++        builtin_define ("_ABI64=3");                  \
++        builtin_define ("_MIPS_SIM=_ABI64");          \
++        builtin_define ("_MIPS_SZLONG=64");           \
++        builtin_define ("_MIPS_SZPTR=64");            \
++      }                                                       \
+       else if (mips_abi == ABI_O64)                   \
+-      builtin_define ("__mips_o64");                  \
++      {                                                       \
++        builtin_define ("_ABIO64=4");                 \
++        builtin_define ("_MIPS_SIM=_ABIO64");         \
++        builtin_define ("_MIPS_SZLONG=64");           \
++        builtin_define ("_MIPS_SZPTR=64");            \
+     }                                                 \
+-  while (0)
++    else if (mips_abi == ABI_EABI)                    \
++      {                                                       \
++        builtin_define ("_ABIEMB=5");                 \
++        builtin_define ("_MIPS_SIM=_ABIEMB");         \
++      if (TARGET_LONG64)                              \
++          builtin_define ("_MIPS_SZLONG=64");         \
++      else                                            \
++          builtin_define ("_MIPS_SZLONG=32");         \
++      if (TARGET_64BIT)                               \
++          builtin_define ("_MIPS_SZPTR=64");          \
++      else                                            \
++          builtin_define ("_MIPS_SZPTR=32");          \
++      }                                                       \
++    else                                              \
++      {                                                       \
++      builtin_define ("_ABIO32=1");                   \
++      builtin_define ("_MIPS_SIM=_ABIO32");           \
++        builtin_define ("_MIPS_SZLONG=32");           \
++        builtin_define ("_MIPS_SZPTR=32");            \
++      }                                                       \
++    if (TARGET_FLOAT64)                                       \
++      builtin_define ("_MIPS_FPSET=32");              \
++    else                                              \
++      builtin_define ("_MIPS_FPSET=16");              \
++                                                      \
++    builtin_define ("_MIPS_SZINT=32");                        \
++  } while (0)
+ 
+ /* The generic MIPS TARGET_CPU_CPP_BUILTINS are incorrect for NetBSD.
+    Specifically, they define too many namespace-invasive macros.  Override



Home | Main Index | Thread Index | Old Index