gcc using wrong as

Jim Wilson wilson@specifix.com
Fri Feb 8 00:36:00 GMT 2008


Antoine Kaufmann wrote:
> after some small changes. But when I tried to compile a simple Hello World, 
> gcc failed with some assembler error messages about illegal operad size with 
> some push instructions. As i guessed they seem to come from the host 64bit 
> as. I compared the error messages by trying to assemble the code manually.

You must use the exact same prefix option when configuring and 
installing binutils as you use when configuring and installing gcc.  If 
you do this, then gcc will find the the right as automatically.  If you 
don't then the gcc driver will need help to find it.

The gcc driver will just search for a program called "as" in a 
pre-defined list of directories.  So you need to make sure it will find 
one there before it finds the one in /usr/bin/as.  The canonical place 
for this is in $prefix/$target/bin/as.  Or you could put it in the same 
directory where cc1 got installed; I think that works too.

The fact that configure found the cross assembler is irrelevant.  This 
is only used during the build process.  It has no effect on where gcc 
looks for the assembler at run time.

Adding the -v option to a gcc run will show some useful info about what 
is going on.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com



More information about the Gcc mailing list