aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/mips/linux.h
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@codesourcery.com>2008-06-18 08:28:07 +0000
committerMaxim Kuvyrkov <mkuvyrkov@gcc.gnu.org>2008-06-18 08:28:07 +0000
commit900e3ae581fac0fa5fb79b790f4be57501fba319 (patch)
tree08ad1899ff895eecff141825004ddfce771bcfae /gcc/config/mips/linux.h
parentb51469a5d825a43e376a647f71cbf1da28149ae1 (diff)
downloadgcc-900e3ae581fac0fa5fb79b790f4be57501fba319.zip
gcc-900e3ae581fac0fa5fb79b790f4be57501fba319.tar.gz
gcc-900e3ae581fac0fa5fb79b790f4be57501fba319.tar.bz2
config.gcc (mips64el-st-linux-gnu): Use mips/st.h and mips/t-st.
* config.gcc (mips64el-st-linux-gnu): Use mips/st.h and mips/t-st. * config.host: Use driver-native.o and mips/x-native for mips*-linux*. * config/mips/linux.h (host_detect_local_cpu): Declare, add to EXTRA_SPEC_FUNCTIONS. (MARCH_MTUNE_NATIVE_SPECS, BASE_DRIVER_SELF_SPECS): New macros. (DRIVER_SELF_SPECS): Adjust. * config/mips/linux64.h (DRIVER_SELF_SPECS): Update. * config/mips/st.h, config/mips/t-st: New. * config/mips/driver-native.c, config/mips/x-native: New. * doc/invoke.texi (MIPS): Document 'native' value for -march and -mtune options. Co-Authored-By: Kazu Hirata <kazu@codesourcery.com> From-SVN: r136888
Diffstat (limited to 'gcc/config/mips/linux.h')
-rw-r--r--gcc/config/mips/linux.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
index 4ee046a..2e7b102 100644
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
@@ -143,9 +143,27 @@ along with GCC; see the file COPYING3. If not see
#ifdef HAVE_AS_NO_SHARED
/* Default to -mno-shared for non-PIC. */
-#define NO_SHARED_SPECS \
+# define NO_SHARED_SPECS \
"%{mshared|mno-shared|fpic|fPIC|fpie|fPIE:;:-mno-shared}"
-#define DRIVER_SELF_SPECS NO_SHARED_SPECS
#else
-#define NO_SHARED_SPECS
+# define NO_SHARED_SPECS ""
#endif
+
+/* -march=native handling only makes sense with compiler running on
+ a MIPS chip. */
+#if defined(__mips__)
+extern const char *host_detect_local_cpu (int argc, const char **argv);
+# define EXTRA_SPEC_FUNCTIONS \
+ { "local_cpu_detect", host_detect_local_cpu },
+
+# define MARCH_MTUNE_NATIVE_SPECS \
+ " %{march=native:%<march=native %:local_cpu_detect(arch)}" \
+ " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"
+#else
+# define MARCH_MTUNE_NATIVE_SPECS ""
+#endif
+
+#define BASE_DRIVER_SELF_SPECS \
+ NO_SHARED_SPECS \
+ MARCH_MTUNE_NATIVE_SPECS
+#define DRIVER_SELF_SPECS BASE_DRIVER_SELF_SPECS