This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Re : [PATCH] Build a tri-arch compiler on mips-linux-gnu
- From: Matthias Klose <doko at ubuntu dot com>
- To: aloiret at debian dot org
- Cc: gcc-patches at gcc dot gnu dot org, Eric Christopher <echristo at apple dot com>, rdsandiford at googlemail dot com
- Date: Wed, 24 Jun 2009 10:03:59 +0200
- Subject: Re: Re : [PATCH] Build a tri-arch compiler on mips-linux-gnu
- References: <20090323143112.GA22291@zelenka.debian.org> <87iqm0m17e.fsf@firetop.home> <dacf4780903231452k408511b6kf3663d6f42f44d43@mail.gmail.com>
Arthur Loiret schrieb:
> 2009/3/23, Richard Sandiford <rdsandiford@googlemail.com>:
>> Looks good, thanks. My only (very) minor nit is that...
> [snip]
>> OK for 4.5 with that change. Do you have a copyright assignment on file?
>
> Yes, but I don't have commit right. Can I ping you again when trunk is
> open for 4.5?
this patch needed an update for the trunk, however I'm unable to get a clean
bootstrap:
20090516 fails to build the 64bit mudflap library
https://buildd.debian.org/fetch.cgi?&pkg=gcc-snapshot&ver=20090516-1&arch=mips&stamp=1243056878&file=log
20090620 fails the bootstrap in libgcc n32
https://buildd.debian.org/fetch.cgi?&pkg=gcc-snapshot&ver=20090620-1&arch=mipsel&stamp=1245806341&file=log
https://buildd.debian.org/fetch.cgi?&pkg=gcc-snapshot&ver=20090620-1&arch=mips&stamp=1245823926&file=log
triarch bootstraps on mipsel64-linux-gnu seem to succeed however:
http://gcc.gnu.org/ml/gcc-testresults/2009-06/msg01881.html
Matthias
2009-06-24 Arthur Loiret <aloiret@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.
* doc/install.texi: Add mips-linux to the list of targets supporting
--enable-targets=all. Document the effect on mips.
Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi (revision 148895)
+++ gcc/doc/install.texi (working copy)
@@ -1316,8 +1316,10 @@
option enables the 32-bit target to be a bi-arch compiler, which is
useful when you want a bi-arch compiler that defaults to 32-bit, and
you are building a bi-arch or multi-arch binutils in a combined tree.
-Currently, this option only affects sparc-linux, powerpc-linux and
-x86-linux.
+On mips-linux, this will build a tri-arch compiler (ABI o32/n32/64),
+defaulted to o32.
+Currently, this option only affects sparc-linux, powerpc-linux, x86-linux
+and mips-linux.
@item --enable-secureplt
This option enables @option{-msecure-plt} by default for powerpc-linux.
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc (revision 148895)
+++ gcc/config.gcc (working copy)
@@ -1627,8 +1627,13 @@
test x$with_llsc != x || with_llsc=yes
;;
mips*-*-linux*) # Linux MIPS, either endian.
- tm_file="dbxelf.h elfos.h svr4.h linux.h glibc-stdint.h ${tm_file} mips/linux.h"
+ tm_file="dbxelf.h elfos.h svr4.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 148895)
+++ 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 148895)
+++ 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