Use mips3 as the default MIPS ISA for 32-bit FreeBSD/mips.
The in-tree GCC 4.2.1 defaults to a MIPS ISA of MIPS3 (which includes ll and sc instructions needed for SMP-aware atomics). However, out of the box GCC defaults to MIPS1 for 32-bit MIPS (N32 and N64 both require a minimum of MIPS3). Change both devel/mips-gcc and base/gcc to default to MIPS3 for 32-bit MIPS on FreeBSD. - Fix the default target cpu to include MASK_ABICALLS in configure.tgt. The gcc/config/mips/freebsd.h header already overrides this anway, but it is more correct to fix this here. We could perhaps remove the hack from freebsd.h now but I haven't done that. - Fix the case that checks for 32-bit mips tuples to match on 'mips*' instead of 'mips32*' in configure.tgt. We don't use mips32* in our tuples for O32 MIPS. - Set MIPS_ISA_DEFAULT to 3 (MIPS3) rather than 33 (MIPS32R6 or some such) for O32. - Remove MIPS_ISA_DEFAULT for N32 to use the default of MIPS3. - Remove hackish driver specs and instead replace with more standard driver specs. Add MIPS_DEFAULT_ISA_LEVEL_SPEC to the default driver specs. This macro forces a suitable MIPS ISA parameter (such as -mips3) to always be added to the flags passed to subcommands. In particular, without this change the compiler would assume MIPS3 by default via MIPS_ISA_DEFAULT but would not pass any flags on to as(1) and as would still use MIPS1. The added macro ensures -mips3 is passed to as(1) if no explicit -march is specified. The upshot of all this is that one no longer has to explicitly specify TARGET_CPUTYPE=mips3 to build O32 MIPS. It should also make /usr/bin/cc from base/gcc more compatible with GCC 4.2.1. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D15543
This commit is contained in:
parent
9d6c7ff01e
commit
577259b6f1
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=472011
@ -8,16 +8,16 @@ index 90d4f71..5a05e22 100644
|
||||
;;
|
||||
+mips*-*-freebsd*) # FreeBSD/mips[64], either endian.
|
||||
+ tm_file="${tm_file} elfos.h ${fbsd_tm_file} mips/elf.h mips/freebsd.h"
|
||||
+ target_cpu_default=MASK_SOFT_FLOAT_ABI
|
||||
+ target_cpu_default="MASK_ABICALLS|MASK_SOFT_FLOAT_ABI"
|
||||
+ case ${target} in
|
||||
+ mips64*-*-freebsd*)
|
||||
+ tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_64"
|
||||
+ ;;
|
||||
+ mips32*-*-freebsd*)
|
||||
+ tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_32 MIPS_ISA_DEFAULT=33"
|
||||
+ ;;
|
||||
+ mipsn32*-*-freebsd*)
|
||||
+ tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32 MIPS_ISA_DEFAULT=33"
|
||||
+ tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
|
||||
+ ;;
|
||||
+ mips*-*-freebsd*)
|
||||
+ tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_32 MIPS_ISA_DEFAULT=3"
|
||||
+ ;;
|
||||
+ esac
|
||||
+ case ${target} in
|
||||
@ -64,7 +64,7 @@ new file mode 100644
|
||||
index 0000000..56a921e
|
||||
--- /dev/null
|
||||
+++ gcc/config/mips/freebsd.h
|
||||
@@ -0,0 +1,347 @@
|
||||
@@ -0,0 +1,320 @@
|
||||
+/* Definitions for MIPS varients running FreeBSD with ELF format
|
||||
+ Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
+ Continued by David O'Brien <obrien@freebsd.org>
|
||||
@ -310,39 +310,12 @@ index 0000000..56a921e
|
||||
+ } \
|
||||
+ while (0)
|
||||
+
|
||||
+/* Default ABI and ISA */
|
||||
+/*
|
||||
+ * XXX/juli
|
||||
+ * Shouldn't this also be dependent on !mips*?
|
||||
+ */
|
||||
+#ifdef MIPS_CPU_STRING_DEFAULT
|
||||
+#define DRIVER_SELF_ISA_SPEC "%{!march=*: -march=" MIPS_CPU_STRING_DEFAULT "}"
|
||||
+#else
|
||||
+#define DRIVER_SELF_ISA_SPEC "%{!march=*: -march=from-abi}"
|
||||
+#endif
|
||||
+
|
||||
+/* Always pass ISA to drivers */
|
||||
+#undef DRIVER_SELF_SPECS
|
||||
+#if MIPS_ABI_DEFAULT == ABI_N32
|
||||
+#define DRIVER_SELF_SPECS \
|
||||
+ "%{!EB:%{!EL:%(endian_spec)}}", \
|
||||
+ "%{!mabi=*: -mabi=n32}", \
|
||||
+ DRIVER_SELF_ISA_SPEC
|
||||
+#elif MIPS_ABI_DEFAULT == ABI_64
|
||||
+#define DRIVER_SELF_SPECS \
|
||||
+ "%{!EB:%{!EL:%(endian_spec)}}", \
|
||||
+ "%{!mabi=*: -mabi=64}", \
|
||||
+ DRIVER_SELF_ISA_SPEC
|
||||
+#elif MIPS_ABI_DEFAULT == ABI_O64
|
||||
+#define DRIVER_SELF_SPECS \
|
||||
+ "%{!EB:%{!EL:%(endian_spec)}}", \
|
||||
+ "%{!mabi=*: -mabi=o64}", \
|
||||
+ DRIVER_SELF_ISA_SPEC
|
||||
+#else /* default to o32 */
|
||||
+#define DRIVER_SELF_SPECS \
|
||||
+ "%{!EB:%{!EL:%(endian_spec)}}", \
|
||||
+ "%{!mabi=*: -mabi=32}", \
|
||||
+ DRIVER_SELF_ISA_SPEC
|
||||
+#endif
|
||||
+#define DRIVER_SELF_SPECS \
|
||||
+ MIPS_DEFAULT_ISA_LEVEL_SPEC, \
|
||||
+ MIPS_ISA_LEVEL_SPEC, \
|
||||
+ BASE_DRIVER_SELF_SPECS
|
||||
+
|
||||
+#if 0
|
||||
+/* Don't default to pcc-struct-return, we want to retain compatibility with
|
||||
|
Loading…
Reference in New Issue
Block a user