PATCH: Explicitly pass --64 to assembler on AMD64 targets

Mark Mitchell mark@codesourcery.com
Mon Jun 13 22:35:00 GMT 2005


Daniel Jacobowitz wrote:
> On Mon, Jun 13, 2005 at 12:56:36PM -0700, Richard Henderson wrote:
> 
>>On Mon, Jun 13, 2005 at 11:16:04AM -0700, Mark Mitchell wrote:
>>
>>>1. For a bi-arch compiler for which 32-bit code is the default, we no
>>>   longer need to override ASM_SPEC.
>>
>>Well, this is the only way this patch applies, because...
>>
>>
>>>2. We get earlier failure and better error messages from the assembler
>>>   if the user tries to use a 64-bit compiler with a 32-bit assembler.
>>
>>... this one isn't true.  You won't get "--64" emitted from just
>>"gcc z.c", only from "gcc -m64 z.c".  Unless I'm missing something?
> 
> 
> Right, I assume Mark meant "if you try to use foo-gcc -m64 with a
> 32-bit assembler".

Right.

>>That said, I guess I don't have a problem with this patch. 
> 
> How would you feel about a patch that made us always pass --64
> as appropriate, at least if the assembler in question is gas?  I
> periodically bootstrap on a 64-bit kernel with a 32-bit root FS.  But
> the assembler and linker are biarch, and the 64-bit libs are installed,
> so it's just the defaults that are wrong.  If we were explicit, an
> x86_64-linux compiler would Just Work.
> 
> Which would be nice since that's what config.guess says to build :-) 

I checked in the version RTH originally approved, after testing on 
x86_64-unknown-linux-gnu.

I would be in favor of making the mode always explicit, as you suggest 
-- but I would prefer that we not embed the assumption that the default 
mode is 64-bit mode in x86-64.h so that we can continue to use that file 
for 32-bit default compilers.  (Perhaps it could go in biarch64.h, which 
assumes 64-bit mode to be the default already?)  Or, at least, make it 
easy for a 32-bit default to override x86-64.h.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304



More information about the Gcc mailing list