Source-Changes-HG archive

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

[src/trunk]: src/external/gpl3/gcc Add support for mipsn64 targets which buil...



details:   https://anonhg.NetBSD.org/src/rev/bc7b18f0a1f3
branches:  trunk
changeset: 1020859:bc7b18f0a1f3
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Apr 25 23:12:53 2021 +0000

description:
Add support for mipsn64 targets which build 64 bit binaries by default
on instead of n32

diffstat:

 external/gpl3/gcc/dist/config.sub                                     |   1 +
 external/gpl3/gcc/dist/gcc/config.gcc                                 |   7 +++++++
 external/gpl3/gcc/dist/gcc/config/mips/netbsd64.h                     |  10 +++++++++-
 external/gpl3/gcc/dist/gcc/config/mips/t-netbsd64                     |  10 +++++++++-
 external/gpl3/gcc/dist/libgcc/config.host                             |   2 +-
 external/gpl3/gcc/lib/crtstuff/Makefile                               |   4 ++--
 external/gpl3/gcc/lib/libgcc/Makefile.inc                             |   5 +++--
 external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile                        |   4 ++--
 external/gpl3/gcc/lib/libstdc++-v3/include/bits/arch/mipso32/Makefile |   4 ++--
 external/gpl3/gcc/lib/libtsan/Makefile                                |   4 ++--
 10 files changed, 38 insertions(+), 13 deletions(-)

diffs (172 lines):

diff -r 04615743fa39 -r bc7b18f0a1f3 external/gpl3/gcc/dist/config.sub
--- a/external/gpl3/gcc/dist/config.sub Sun Apr 25 22:45:16 2021 +0000
+++ b/external/gpl3/gcc/dist/config.sub Sun Apr 25 23:12:53 2021 +0000
@@ -1191,6 +1191,7 @@
                        | mips | mipsbe | mipseb | mipsel | mipsle \
                        | mips16 \
                        | mips64 | mips64eb | mips64el \
+                       | mipsn64 | mipsn64eb | mipsn64el \
                        | mips64octeon | mips64octeonel \
                        | mips64orion | mips64orionel \
                        | mips64r5900 | mips64r5900el \
diff -r 04615743fa39 -r bc7b18f0a1f3 external/gpl3/gcc/dist/gcc/config.gcc
--- a/external/gpl3/gcc/dist/gcc/config.gcc     Sun Apr 25 22:45:16 2021 +0000
+++ b/external/gpl3/gcc/dist/gcc/config.gcc     Sun Apr 25 23:12:53 2021 +0000
@@ -2570,6 +2570,13 @@
        gas=yes
        gcc_cv_initfini_array=yes
        ;;
+mipsn64*-*-netbsd*)                    # NetBSD/mips64, either endian.
+       target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_SOFT_FLOAT_ABI"
+       tm_file="elfos.h ${tm_file} mips/elf.h ${nbsd_tm_file} mips/netbsd.h mips/netbsd64.h"
+       tmake_file="${tmake_file} mips/t-netbsd64"
+       tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_64"
+       extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+       ;;
 mips64*-*-netbsd*)                     # NetBSD/mips64, either endian.
        target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_SOFT_FLOAT_ABI"
        tm_file="elfos.h ${tm_file} mips/elf.h ${nbsd_tm_file} mips/netbsd.h mips/netbsd64.h"
diff -r 04615743fa39 -r bc7b18f0a1f3 external/gpl3/gcc/dist/gcc/config/mips/netbsd64.h
--- a/external/gpl3/gcc/dist/gcc/config/mips/netbsd64.h Sun Apr 25 22:45:16 2021 +0000
+++ b/external/gpl3/gcc/dist/gcc/config/mips/netbsd64.h Sun Apr 25 23:12:53 2021 +0000
@@ -22,11 +22,19 @@
 /* Force the default endianness and ABI flags onto the command line
    in order to make the other specs easier to write.  */
 
+#if MIPS_ABI_DEFAULT == ABI_N32
+# define MIPS64_ABI "%{!mabi=*: -mabi=n32}"
+# elif MIPS_ABI_DEFAULT == ABI_64
+# define MIPS64_ABI "%{!mabi=*: -mabi=64}"
+#else
+# error "Missing MIPS_ABI_DEFAULT " # MIPS_ABI_DEFAULT
+#endif
+
 #undef DRIVER_SELF_SPECS
 #define DRIVER_SELF_SPECS \
   BASE_DRIVER_SELF_SPECS \
   "%{!EB:%{!EL:%(endian_spec)}}", \
-  "%{!mabi=*: -mabi=n32}"
+  MIPS64_ABI
 
 /* Define default target values.  */
 
diff -r 04615743fa39 -r bc7b18f0a1f3 external/gpl3/gcc/dist/gcc/config/mips/t-netbsd64
--- a/external/gpl3/gcc/dist/gcc/config/mips/t-netbsd64 Sun Apr 25 22:45:16 2021 +0000
+++ b/external/gpl3/gcc/dist/gcc/config/mips/t-netbsd64 Sun Apr 25 23:12:53 2021 +0000
@@ -1,9 +1,17 @@
 # NetBSD has (will have) "non-native" libraries in /usr/lib/<arch>.
-# For NetBSD/mips64 we thus have /usr/lib (n32), /usr/lib/o32 and /usr/lib/64.
 
 MULTILIB_OPTIONS = mabi=n32/mabi=64/mabi=32
 MULTILIB_DIRNAMES = n32 n64 o32
+
+# For NetBSD/mips64 we thus have /usr/lib (n32), /usr/lib/o32 and /usr/lib/64.
+ifneq ($(filter MIPS_ABI_DEFAULT=ABI_N32,$(tm_defines)),)
 MULTILIB_OSDIRNAMES = . ../lib/64 ../lib/o32
+endif
+
+# For NetBSD/mipsn64 we thus have /usr/lib (64), /usr/lib/o32 and /usr/lib/n32.
+ifneq ($(filter MIPS_ABI_DEFAULT=ABI_64,$(tm_defines)),)
+MULTILIB_OSDIRNAMES = ../lib/n32 . ../lib/o32
+endif
 
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
diff -r 04615743fa39 -r bc7b18f0a1f3 external/gpl3/gcc/dist/libgcc/config.host
--- a/external/gpl3/gcc/dist/libgcc/config.host Sun Apr 25 22:45:16 2021 +0000
+++ b/external/gpl3/gcc/dist/libgcc/config.host Sun Apr 25 23:12:53 2021 +0000
@@ -1056,7 +1056,7 @@
        tmake_file="$tmake_file mips/t-elf mips/t-crtstuff"
        extra_parts="$extra_parts crti.o crtn.o"
        ;;
-mips64-*-elf* | mips64el-*-elf*)
+mips64-*-elf* | mips64el-*-elf* | mipsn64-*-elf* | mipsn64el-*-elf*)
        tmake_file="$tmake_file mips/t-elf mips/t-crtstuff mips/t-mips16"
        extra_parts="$extra_parts crti.o crtn.o"
        ;;
diff -r 04615743fa39 -r bc7b18f0a1f3 external/gpl3/gcc/lib/crtstuff/Makefile
--- a/external/gpl3/gcc/lib/crtstuff/Makefile   Sun Apr 25 22:45:16 2021 +0000
+++ b/external/gpl3/gcc/lib/crtstuff/Makefile   Sun Apr 25 23:12:53 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.14 2016/03/15 19:21:27 mrg Exp $
+#      $NetBSD: Makefile,v 1.15 2021/04/25 23:12:54 christos Exp $
 
 REQUIRETOOLS=  yes
 NOLINT=                # defined
@@ -66,7 +66,7 @@
        ${CC} ${CPPFLAGS} ${CPPFLAGS.${.TARGET}} ${GCFLAGS} ${COPTS} ${COPTS.${.TARGET}} ${CPUFLAGS} -c ${.IMPSRC} -o ${.TARGET}.o
        mv ${.TARGET}.o ${.TARGET}
 
-.if (${MACHINE_ARCH} == "mips64eb") || (${MACHINE_ARCH} == "mips64el")
+.if ${MACHINE_MIPS64}
 # Turn off as(1) warnings on MIPS, since warnings are fatal with WARNS>0
 # and GCC configury passes -finhibit-size-directive which causes mips-gas
 # to barf.  Don't know what the real fix for this is...
diff -r 04615743fa39 -r bc7b18f0a1f3 external/gpl3/gcc/lib/libgcc/Makefile.inc
--- a/external/gpl3/gcc/lib/libgcc/Makefile.inc Sun Apr 25 22:45:16 2021 +0000
+++ b/external/gpl3/gcc/lib/libgcc/Makefile.inc Sun Apr 25 23:12:53 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.50 2021/04/24 06:34:52 rin Exp $
+#      $NetBSD: Makefile.inc,v 1.51 2021/04/25 23:12:54 christos Exp $
 
 LIBGCC_MACHINE_ARCH?=${MACHINE_ARCH:S/earmv5/earm/}
 GCC_MACHINE_SUBDIR=${MACHINE_CPU:C/powerpc.*/rs6000/:C/x86_64/i386/}
@@ -69,7 +69,8 @@
 .if ${LIBGCC_MACHINE_ARCH} != "coldfire" && \
     empty(LIBGCC_MACHINE_ARCH:Mearm*) && \
     empty(LIBGCC_MACHINE_ARCH:Maarch64*) && \
-    empty(LIBGCC_MACHINE_ARCH:Mmips64*)
+    empty(LIBGCC_MACHINE_ARCH:Mmips64*) && \
+    empty(LIBGCC_MACHINE_ARCH:Mmipsn64*)
 
 EXTRA_FUNC_SIZES=      sf df xf
 
diff -r 04615743fa39 -r bc7b18f0a1f3 external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile
--- a/external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile    Sun Apr 25 22:45:16 2021 +0000
+++ b/external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile    Sun Apr 25 23:12:53 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.15 2021/04/12 00:05:55 mrg Exp $
+#      $NetBSD: Makefile,v 1.16 2021/04/25 23:12:54 christos Exp $
 
 USE_SHLIBDIR=  yes
 REQUIRETOOLS=  yes
@@ -29,7 +29,7 @@
 .endif
 
 # XXXGCC5 GCC 5.3 has all these in libgcc and we have them in libc.
-.if ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
+.if ${MACHINE_MIPS64}
 LIB2ADD_EDITED= 
${G_LIB2ADD:T:Nfloatsisf.c:Nfloatunsisf.c:Nfloatsidf.c:Nfloatunsidf.c:Nfixsfsi.c:Nextendsfdf2.c:Naddsf3.c:Nmulsf3.c:Ndivsf3.c:Nadddf3.c:Nsubdf3.c:Nmuldf3.c:Ndivdf3.c:Nfixdfsi.c:S/.asm/.S/}
 .else
 LIB2ADD_EDITED=        ${G_LIB2ADD:T:S/.asm/.S/}
diff -r 04615743fa39 -r bc7b18f0a1f3 external/gpl3/gcc/lib/libstdc++-v3/include/bits/arch/mipso32/Makefile
--- a/external/gpl3/gcc/lib/libstdc++-v3/include/bits/arch/mipso32/Makefile     Sun Apr 25 22:45:16 2021 +0000
+++ b/external/gpl3/gcc/lib/libstdc++-v3/include/bits/arch/mipso32/Makefile     Sun Apr 25 23:12:53 2021 +0000
@@ -1,7 +1,7 @@
-#      $NetBSD: Makefile,v 1.1 2014/03/01 10:00:48 mrg Exp $
+#      $NetBSD: Makefile,v 1.2 2021/04/25 23:12:54 christos Exp $
 
 GCC_MACHINE_ARCH=mipso32
 .include "../Makefile.arch_bits"
 
 # mips o32 files are in mipse[lb] subdirs.
-.PATH: ${.CURDIR}/../../../../arch/${MACHINE_ARCH:S/64//}
+.PATH: ${.CURDIR}/../../../../arch/${MACHINE_ARCH:S/mipsn/mips/:S/64//}
diff -r 04615743fa39 -r bc7b18f0a1f3 external/gpl3/gcc/lib/libtsan/Makefile
--- a/external/gpl3/gcc/lib/libtsan/Makefile    Sun Apr 25 22:45:16 2021 +0000
+++ b/external/gpl3/gcc/lib/libtsan/Makefile    Sun Apr 25 23:12:53 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2020/09/14 15:01:58 kamil Exp $
+# $NetBSD: Makefile,v 1.16 2021/04/25 23:12:54 christos Exp $
 
 UNSUPPORTED_COMPILER.clang=     # defined
 NOSANITIZER=    # defined
@@ -52,7 +52,7 @@
 TSAN_SRCS+= tsan_rtl_amd64.S
 .elif ${MACHINE_ARCH} == "aarch64"
 TSAN_SRCS+= tsan_rtl_aarch64.S
-.elif ${MACHINE_ARCH} == "mips64el"
+.elif ${MACHINE_MIPS64}
 TSAN_SRCS+= tsan_rtl_mips64.S
 .elif ${MACHINE_ARCH} == "powerpc64"
 TSAN_SRCS+= tsan_rtl_ppc64.S



Home | Main Index | Thread Index | Old Index