This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix mv8plus, allow targetting Linux or Solaris from other sparc host.
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: David Miller <davem at davemloft dot net>
- Cc: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Sun, 23 Oct 2011 00:22:14 +0200
- Subject: Re: [PATCH] Fix mv8plus, allow targetting Linux or Solaris from other sparc host.
- References: <20111015.000037.1848925948067989664.davem@davemloft.net>
> You can't just fix this -mv8plus problem universally using spec
> tricks. Spec rules such as "{!-mcpu*:-mcpu=v9}" never trigger for the
> default bitness, because OPTION_DEFAULT_SPECS appends "-mcpu=v7" or
> similar to the command line first.
>
> Therefore, I put the cpu bump to v9 into sparc_override_options()
> itself, this handles all possible cases.
This breaks -mcpu on Solaris though because TARGET_DEFAULT has MASK_V8PLUS.
So any setting below or equal to -mcpu=v8 triggers an architecture mismatch
between assembler and compiler.
I think we need to go the specs route. I'd just add a mv8plus rule to CC1_SPEC
in config/sparc/linux64.h similar to the one present in config/sparc/sol2.h.
This works as OPTION_DEFAULT_SPECS shouldn't prepend anything if you pass -m32.
But I presume this still leaves us with the problem for the 32-bit compiler.
--
Eric Botcazou