This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Add mipsisa64r2-*-elf configurations
- From: Adam Nemet <anemet at caviumnetworks dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 18 Nov 2008 12:19:29 -0800
- Subject: [PATCH] Add mipsisa64r2-*-elf configurations
Besides adding the -unknown-elf and -sde-elf variants, the patch also fixes a
problem with the mipsisa64-sde-elf configuration. Hopefully this will make
the patch more acceptable at this stage ;).
t-sde tries to exclude the mips16 libs for 64-bit with MULTILIB_EXCLUSIONS.
However, if -mips64 is in the MULTILIB_DEFAULTS you can't use mips64 to
specify MULTILIB_EXCLUSIONS -- you need to use the inverse with !. (This is
BTW how the -mfp64 exclusions are specified a few lines above.) Due to this
bug, the mips16 multilibs are not built in this configuration.
Tested with mipsisa64r2-elf by comparing the results to mipsisa64-elf. There
are a few differences but they all seem to be related to one issue which I am
fixing in my next patch.
I also checked with -print-multi-lib that the multilibs look good for
mipsisa{32,32r2,64,64r2}-sde-elf. I also built mipsisa64r2-sde-elf and
mipsisa64r2-elfoabi with their multilibs.
OK to install?
Adam
gcc/
* config.gcc (mips*-sde-elf*): Handle mipsisa64r2*.
(mipsisa64r2-*-elf*, mipsisa64r2el-*-elf*): Add new cases to
mipsisa*-*-elf*. Handle mipsisa64r2*.
* config/mips/sde.h (LINK_SPEC): Handle -mips64r2.
* config/mips/t-isa3264 (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): Add
mips64r2.
(MULTILIB_EXCLUSIONS): Add mips64r2/mfp64.
* config/mips/t-sde (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): Add
mips64r2.
(MULTILIB_EXCLUSIONS): Add mips64r2/mfp64. Add mips64r2/mips16.
Fix mips16 if mips64 or mips64r2 are multilib defaults.
* config/mips/t-sdemtk (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): Add
mips64r2.
libgcc/
* config.host (mipsisa64r2-*-elf* | mipsisa64r2el-*-elf*): New
case.
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc (revision 141180)
+++ gcc/config.gcc (working copy)
@@ -1614,6 +1614,9 @@ mips*-sde-elf*)
mipsisa32*)
tm_defines="MIPS_ISA_DEFAULT=32 MIPS_ABI_DEFAULT=ABI_32"
;;
+ mipsisa64r2*)
+ tm_defines="MIPS_ISA_DEFAULT=65 MIPS_ABI_DEFAULT=ABI_N32"
+ ;;
mipsisa64*)
tm_defines="MIPS_ISA_DEFAULT=64 MIPS_ABI_DEFAULT=ABI_N32"
;;
@@ -1621,7 +1624,8 @@ mips*-sde-elf*)
;;
mipsisa32-*-elf* | mipsisa32el-*-elf* | \
mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \
-mipsisa64-*-elf* | mipsisa64el-*-elf*)
+mipsisa64-*-elf* | mipsisa64el-*-elf* | \
+mipsisa64r2-*-elf* | mipsisa64r2el-*-elf*)
tm_file="elfos.h ${tm_file} mips/elf.h"
tmake_file="mips/t-isa3264 mips/t-libgcc-mips16"
case ${target} in
@@ -1631,6 +1635,9 @@ mipsisa64-*-elf* | mipsisa64el-*-elf*)
mipsisa32*)
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
;;
+ mipsisa64r2*)
+ tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
+ ;;
mipsisa64*)
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64"
;;
Index: gcc/config/mips/sde.h
===================================================================
--- gcc/config/mips/sde.h (revision 141180)
+++ gcc/config/mips/sde.h (working copy)
@@ -62,7 +62,7 @@ along with GCC; see the file COPYING3.
#undef LINK_SPEC
#define LINK_SPEC "\
%(endian_spec) \
-%{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips32r2} %{mips64} \
+%{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32*} %{mips64*} \
%{bestGnum} \
%{shared} %{non_shared} %{call_shared} \
%{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \
Index: gcc/config/mips/t-isa3264
===================================================================
--- gcc/config/mips/t-isa3264 (revision 141180)
+++ gcc/config/mips/t-isa3264 (working copy)
@@ -17,13 +17,13 @@ TARGET_LIBGCC2_CFLAGS = -G 0
# Build the libraries for both hard and soft floating point
ifneq ($(filter MIPS_ABI_DEFAULT=ABI_EABI,$(tm_defines)),)
-MULTILIB_OPTIONS = msoft-float EL/EB mips32/mips32r2/mips64
-MULTILIB_DIRNAMES = soft-float el eb mips32 mips32r2 mips64
+MULTILIB_OPTIONS = msoft-float EL/EB mips32/mips32r2/mips64/mips64r2
+MULTILIB_DIRNAMES = soft-float el eb mips32 mips32r2 mips64 mips64r2
else
-MULTILIB_OPTIONS = msoft-float/mfp64 EL/EB mips32/mips32r2/mips64
-MULTILIB_DIRNAMES = soft-float fp64 el eb mips32 mips32r2 mips64
+MULTILIB_OPTIONS = msoft-float/mfp64 EL/EB mips32/mips32r2/mips64/mips64r2
+MULTILIB_DIRNAMES = soft-float fp64 el eb mips32 mips32r2 mips64 mips64r2
ifneq ($(filter MIPS_ISA_DEFAULT=33,$(tm_defines)),)
-MULTILIB_EXCLUSIONS = mips32/mfp64 mips64/mfp64
+MULTILIB_EXCLUSIONS = mips32/mfp64 mips64/mfp64 mips64r2/mfp64
else
MULTILIB_EXCLUSIONS = !mips32r2/mfp64
endif
Index: gcc/config/mips/t-sde
===================================================================
--- gcc/config/mips/t-sde (revision 141180)
+++ gcc/config/mips/t-sde (working copy)
@@ -10,19 +10,23 @@ $(T)crtn.o: $(srcdir)/config/mips/crtn.a
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm
-MULTILIB_OPTIONS = EL/EB mips32/mips32r2/mips64 mips16 msoft-float/mfp64 mcode-readable=no
-MULTILIB_DIRNAMES = el eb mips32 mips32r2 mips64 mips16 sof f64 spram
+MULTILIB_OPTIONS = EL/EB mips32/mips32r2/mips64/mips64r2 mips16 msoft-float/mfp64 mcode-readable=no
+MULTILIB_DIRNAMES = el eb mips32 mips32r2 mips64 mips64r2 mips16 sof f64 spram
MULTILIB_MATCHES = EL=mel EB=meb
# The -mfp64 option is only valid in conjunction with -mips32r2.
ifneq ($(filter MIPS_ISA_DEFAULT=33,$(tm_defines)),)
-MULTILIB_EXCLUSIONS := mips32/mfp64 mips64/mfp64
+MULTILIB_EXCLUSIONS := mips32/mfp64 mips64/mfp64 mips64r2/mfp64
else
MULTILIB_EXCLUSIONS := !mips32r2/mfp64
endif
# Don't build 64-bit MIPS16 multilibs.
-MULTILIB_EXCLUSIONS += mips16/mips64
+ifneq ($(filter MIPS_ISA_DEFAULT=6%,$(tm_defines)),)
+MULTILIB_EXCLUSIONS += !mips32/!mips32r2/mips16
+else
+MULTILIB_EXCLUSIONS += mips64/mips16 mips64r2/mips16
+endif
EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
Index: gcc/config/mips/t-sdemtk
===================================================================
--- gcc/config/mips/t-sdemtk (revision 141180)
+++ gcc/config/mips/t-sdemtk (working copy)
@@ -1,8 +1,8 @@
# Override newlib settings in t-sde and set up for building
# against SDE header files and libraries.
-MULTILIB_OPTIONS = EL/EB mips32/mips32r2/mips64 mips16 msoft-float/mno-float/mfp64
-MULTILIB_DIRNAMES = el eb mips32 mips32r2 mips64 mips16 sof nof f64
+MULTILIB_OPTIONS = EL/EB mips32/mips32r2/mips64/mips64r2 mips16 msoft-float/mno-float/mfp64
+MULTILIB_DIRNAMES = el eb mips32 mips32r2 mips64 mips64r2 mips16 sof nof f64
# Remove stdarg.h and stddef.h from USER_H.
USER_H = $(srcdir)/ginclude/float.h \
Index: libgcc/config.host
===================================================================
--- libgcc/config.host (revision 141180)
+++ libgcc/config.host (working copy)
@@ -395,6 +395,8 @@ mipsisa32r2-*-elf* | mipsisa32r2el-*-elf
;;
mipsisa64-*-elf* | mipsisa64el-*-elf*)
;;
+mipsisa64r2-*-elf* | mipsisa64r2el-*-elf*)
+ ;;
mipsisa64sr71k-*-elf*)
;;
mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)