[PATCH] Fix mv8plus, allow targetting Linux or Solaris from other sparc host.

Eric Botcazou ebotcazou@adacore.com
Sun Oct 23 08:13:00 GMT 2011

> 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

More information about the Gcc-patches mailing list