diff mbox

Re : [PATCH] Build a tri-arch compiler on mips-linux-gnu

Message ID 4E1ADD57.7000801@debian.org
State New
Headers show

Commit Message

Matthias Klose July 11, 2011, 11:24 a.m. UTC
On 06/25/2009 11:23 AM, Arthur Loiret wrote:
> Hello,
> 
> 2009/6/24, Matthias Klose <doko@debian.org>:
>> Richard Sandiford schrieb:
>>> Thanks for the update.
>>>
>>> This patch didn't go in at the time because Arthur's copyright
>>> assignment went astray somewhere.  Arthur, do you know if
>>> everything's sorted now?
>>
>> the citation above is from Arthur: "Yes, but I don't have commit right. Can
>> I
>> ping you again when trunk is open for 4.5?"
> 
> No, I didn't send the new one yet. I'll do it in the in the next days.

updated, and checked in, (re-approved by Richard).

  Matthias
gcc/

2011-07-11  Arthur Loiret  <aloiret@debian.org>
	    Matthias Klose <doko@debian.org>

	* config.gcc (mips*-*-linux*): If 'enabled_targets' is 'all', build
	a tri-arch compiler defaulting to 32-bit (ABI o32). In this case:
	(tm_file): Add mips/linux64.h.
	(tmake_file): Add mips/t-linux64.
	(tm_defines): Add MIPS_ABI_DEFAULT=ABI_32.
	* config/mips/linux64.h (DRIVER_SELF_SPECS): Use MULTILIB_ABI_DEFAULT
	instead of hardcoded mabi=n32.
	* config/mips/t-linux64 (MULTILIB_DIRNAMES): Set to 'n32 . 64' if
	tm_defines contains MIPS_ABI_DEFAULT ABI_32, to follow the glibc
	convention.
diff mbox

Patch

Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc	(revision 176144)
+++ gcc/config.gcc	(working copy)
@@ -1862,6 +1862,11 @@ 
 mips*-*-linux*)				# Linux MIPS, either endian.
         tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/linux.h"
 	tmake_file="${tmake_file} mips/t-libgcc-mips16"
+	if test x$enable_targets = xall; then
+		tm_file="${tm_file} mips/linux64.h"
+		tmake_file="${tmake_file} mips/t-linux64"
+		tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_32"
+	fi
 	case ${target} in
         mipsisa32r2*)
 		tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33"
Index: gcc/config/mips/linux64.h
===================================================================
--- gcc/config/mips/linux64.h	(revision 176144)
+++ gcc/config/mips/linux64.h	(working copy)
@@ -26,7 +26,7 @@ 
   BASE_DRIVER_SELF_SPECS, \
   LINUX_DRIVER_SELF_SPECS \
   " %{!EB:%{!EL:%(endian_spec)}}" \
-  " %{!mabi=*: -mabi=n32}"
+  " %{!mabi=*: -" MULTILIB_ABI_DEFAULT "}"
 
 #undef LIB_SPEC
 #define LIB_SPEC "\
Index: gcc/config/mips/t-linux64
===================================================================
--- gcc/config/mips/t-linux64	(revision 176144)
+++ gcc/config/mips/t-linux64	(working copy)
@@ -17,7 +17,11 @@ 
 # <http://www.gnu.org/licenses/>.
 
 MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
+ifneq ($(filter MIPS_ABI_DEFAULT=ABI_32,$(tm_defines)),)
+MULTILIB_DIRNAMES = n32 . 64
+else
 MULTILIB_DIRNAMES = n32 32 64
+endif
 MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64
 
 EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o