aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/sparc/linux.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-09-05 15:58:57 +0000
committerDavid S. Miller <davem@gcc.gnu.org>2011-09-05 08:58:57 -0700
commit0913b2d64ed9926d38d1de2370df11b0f98a49e0 (patch)
tree28e0f89376e70e9138d02dc51fd4b9cc290119b0 /gcc/config/sparc/linux.h
parente42bcfa38cc3f3315d10f448675807eee860ae3c (diff)
downloadgcc-0913b2d64ed9926d38d1de2370df11b0f98a49e0.zip
gcc-0913b2d64ed9926d38d1de2370df11b0f98a49e0.tar.gz
gcc-0913b2d64ed9926d38d1de2370df11b0f98a49e0.tar.bz2
config.host: Add driver-sparc.o and sparc/x-sparc on native sparc*-*-linux* builds.
* config.host: Add driver-sparc.o and sparc/x-sparc on native sparc*-*-linux* builds. * config/sparc/driver-sparc.c: Correct Linux strings. * config/sparc/linux.h: Add DRIVER_SELF_SPECS. * config/sparc/linux64.h: Likewise. * doc/invoke.texi: Document that Linux also supports -mcpu=native and -mtune=native on sparc. From-SVN: r178553
Diffstat (limited to 'gcc/config/sparc/linux.h')
-rw-r--r--gcc/config/sparc/linux.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index a9b630e..0ad4b34 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -39,6 +39,22 @@ along with GCC; see the file COPYING3. If not see
"%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s\
%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
+/* -mcpu=native handling only makes sense with compiler running on
+ a SPARC chip. */
+#if defined(__sparc__)
+extern const char *host_detect_local_cpu (int argc, const char **argv);
+# define EXTRA_SPEC_FUNCTIONS \
+ { "local_cpu_detect", host_detect_local_cpu },
+
+# define MCPU_MTUNE_NATIVE_SPECS \
+ " %{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}" \
+ " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"
+#else
+# define MCPU_MTUNE_NATIVE_SPECS ""
+#endif
+
+#define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
+
/* This is for -profile to use -lc_p instead of -lc. */
#undef CC1_SPEC
#define CC1_SPEC "%{profile:-p} \