This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problematic behavior of -Av8plus/-xarch=v8plus on SPARC


For a few weeks GCC mainline has had a bunch of LTO failures on SPARC/Solaris 
with GNU as in 32-bit mode.  The lto1 compiler errors out with the message:
  inconsistent file architecture detected

The 32-bit compiler defaults to -mcpu=v9 on Solaris so -xarch=v8plus is passed 
to gas, which translates it into -Av8plus -32.  The problem is the behavior 
described in config/tc-sparc.c:

 *		The default is to start at v6, and bump the architecture up
 *		whenever an instruction is seen at a higher level.  In 32 bit
 *		environments, v9 is not bumped up to, the user must pass
 * 		-Av8plus{,a,b}.

That part is fine.

 *		If an architecture is specified, all instructions must match
 *		that architecture.  Any higher level instructions are flagged
 *		as errors.  Note that in the 32 bit environment specifying
 *		-Av8plus does not automatically create a v8plus object file, a
 *		v9 insn must be seen.

That part isn't because, when -flto is specified, GCC can generate essentially 
empty assembly files (containing only strings) that are thus assembled into v8 
object files by gas, while regular assembly files are assembled into v8+ ones.
As a result, lto1 chokes when trying to load them together.

Now the Sun assembler (at least Sun WorkShop 6 2001/04/02 and 2003/12/18) 
behaves differently: while you need to specify -xarch=v8plus to assemble v9 
insns, if you specify it, you get a v8+ object file whatever its contents.

What should we do here?  Teach lto1 that v8 and v8+ are essentially the same, 
change the behavior of -Av8plus/-xarch=v8plus to match that of Sun as, or 
something else?

-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]