summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2010-03-05 16:56:08 +0000
committerimp <imp@FreeBSD.org>2010-03-05 16:56:08 +0000
commitb1fc86a42d4ae47c0d66870334f95ecd5c75ccef (patch)
treec8b4d19864a0818f4c2812f205b3c2070da2f051 /contrib/gcc
parentba646ecd6fecd8f82a5df041fa3818b1f49cb375 (diff)
downloadFreeBSD-src-b1fc86a42d4ae47c0d66870334f95ecd5c75ccef.zip
FreeBSD-src-b1fc86a42d4ae47c0d66870334f95ecd5c75ccef.tar.gz
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
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/config/mips/freebsd.h41
1 files changed, 31 insertions, 10 deletions
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
OpenPOWER on IntegriCloud