From b1fc86a42d4ae47c0d66870334f95ecd5c75ccef Mon Sep 17 00:00:00 2001 From: imp Date: Fri, 5 Mar 2010 16:56:08 +0000 Subject: Add support for o32 (when it isn't the default), n32, n64, and o64 to the linker spec. Provide the ability to have a default ABI that's different than o32 (again, for all 4). Submitted by: C. Jayachandran (JC) with tweaks for o64/o32 by me --- contrib/gcc/config/mips/freebsd.h | 41 +++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) (limited to 'contrib/gcc') diff --git a/contrib/gcc/config/mips/freebsd.h b/contrib/gcc/config/mips/freebsd.h index b4752ed..207ea16 100644 --- a/contrib/gcc/config/mips/freebsd.h +++ b/contrib/gcc/config/mips/freebsd.h @@ -65,12 +65,17 @@ Boston, MA 02110-1301, USA. */ #undef LINK_SPEC #define LINK_SPEC "\ - %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips32r2} %{mips64} \ + %{G*} %{mips1} %{mips2} %{mips3} %{mips4} \ + %{mips32} %{mips32r2} %{mips64} %{mips64r2} \ %{bestGnum} %{call_shared} %{no_archive} %{exact_version} \ - %(fbsd_link_spec) " -#if 0 - %(endian_spec) -#endif + %{mabi=32:-melf32%{EB:b}%{EL:l}tsmip_fbsd} \ + %{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32_fbsd} \ + %{mabi=64:-melf64%{EB:b}%{EL:l}tsmip_fbsd} \ + %{mabi=o64:-melf64%{EB:b}%{EL:l}tsmip_fbsd} \ + %(fbsd_link_spec) \ + %(endian_spec) \ + %(fbsd_link_spec)" + /* Reset our STARTFILE_SPEC which was properly set in config/freebsd.h but trashed by config/mips/elf.h. */ @@ -250,12 +255,28 @@ Boston, MA 02110-1301, USA. */ } \ while (0) -/* Default to the mips32 ISA */ -#undef DRIVER_SELF_SPECS +/* Default ABI and ISA */ +#undef DRIVER_SELF_SPECS +#if MIPS_ABI_DEFAULT == ABI_N32 #define DRIVER_SELF_SPECS \ - "%{!march=*: -march=mips32}" -#if 0 - "%{!EB:%{!EL:%(endian_spec)}}", + "%{!EB:%{!EL:%(endian_spec)}}", \ + "%{!march=*: -march=mips64}", \ + "%{!mabi=*: -mabi=n32}" +#elif MIPS_ABI_DEFAULT == ABI_64 +#define DRIVER_SELF_SPECS \ + "%{!EB:%{!EL:%(endian_spec)}}", \ + "%{!march=*: -march=mips64}", \ + "%{!mabi=*: -mabi=64}" +#elif MIPS_ABI_DEFAULT == ABI_O64 +#define DRIVER_SELF_SPECS \ + "%{!EB:%{!EL:%(endian_spec)}}", \ + "%{!march=*: -march=mips64}", \ + "%{!mabi=*: -mabi=o64}" +#else /* default to o32 */ +#define DRIVER_SELF_SPECS \ + "%{!EB:%{!EL:%(endian_spec)}}", \ + "%{!march=*: -march=mips32}", \ + "%{!mabi=*: -mabi=32}" #endif #if 0 -- cgit v1.1