From c708d31a9b5d29328b9cb31a470a3c8099571fe2 Mon Sep 17 00:00:00 2001 From: davem Date: Mon, 5 Sep 2011 15:58:57 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178553 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 12 +++++++++++- gcc/config.host | 8 ++++++++ gcc/config/sparc/driver-sparc.c | 18 ++++++++++++++++-- gcc/config/sparc/linux.h | 16 ++++++++++++++++ gcc/config/sparc/linux64.h | 16 ++++++++++++++++ gcc/doc/invoke.texi | 6 +++--- 6 files changed, 70 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1534d47..e605ce2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2011-09-05 David S. Miller + + * 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. + 2011-09-05 Georg-Johann Lay PR target/50289 @@ -14,7 +24,7 @@ calculations. 2011-09-05 Georg-Johann Lay - + * config/avr/avr.h (progmem_section): Remove Declaration. * config/avr/avr.c (progmem_section): Make static and rename to progmem_swtable_section. diff --git a/gcc/config.host b/gcc/config.host index 61a00b5..df8ba8f 100644 --- a/gcc/config.host +++ b/gcc/config.host @@ -165,6 +165,14 @@ case ${host} in ;; esac ;; + sparc*-*-linux*) + case ${target} in + sparc*-*-linux*) + host_extra_gcc_objs="driver-sparc.o" + host_xmake_file="${host_xmake_file} sparc/x-sparc" + ;; + esac + ;; esac # Machine-specific settings. diff --git a/gcc/config/sparc/driver-sparc.c b/gcc/config/sparc/driver-sparc.c index e5b91bc..f6a4e7c 100644 --- a/gcc/config/sparc/driver-sparc.c +++ b/gcc/config/sparc/driver-sparc.c @@ -58,7 +58,21 @@ static const struct cpu_names { { "SPARC-T3", "niagara2" }, { "SPARC-T4", "niagara2" }, #else - /* FIXME: Provide Linux/SPARC values. */ + { "SuperSPARC", "supersparc" }, + { "HyperSparc", "hypersparc" }, + { "SpitFire", "ultrasparc" }, + { "BlackBird", "ultrasparc" }, + { "Sabre", "ultrasparc" }, + { "Hummingbird", "ultrasparc" }, + { "Cheetah", "ultrasparc3" }, + { "Jalapeno", "ultrasparc3" }, + { "Jaguar", "ultrasparc3" }, + { "Panther", "ultrasparc3" }, + { "Serrano", "ultrasparc3" }, + { "UltraSparc T1", "niagara" }, + { "UltraSparc T2", "niagara2" }, + { "UltraSparc T3", "niagara2" }, + { "UltraSparc T4", "niagara2" }, #endif { NULL, NULL } }; @@ -137,7 +151,7 @@ host_detect_local_cpu (int argc, const char **argv) return NULL; while (fgets (buf, sizeof (buf), f) != NULL) - if (strncmp (buf, "cpu model", sizeof ("cpu model") - 1) == 0) + if (strncmp (buf, "cpu\t\t:", sizeof ("cpu\t\t:") - 1) == 0) { for (i = 0; cpu_names [i].name; i++) if (strstr (buf, cpu_names [i].name) != NULL) 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:%