[Fwd: sh4-cross-compiling-gcc-3.0.2 build fails during assembly]

Kai Ruottu kai.ruottu@luukku.com
Thu Jan 17 03:45:00 GMT 2002


Dan Kegel wrote:
> 
> Hey folks,
> we're having a problem building gcc-3.0.2 for sh4 on an x86 system.
> It looks like the build process for gcc is using 'as' without
> a prefix, so it's getting the system 'as', which can't understand
> the output of sh4 gcc (naturally).

 This is completely right, each cross-compiler has its 'ar', 'as', 'ld',
'nm', 'ranlib' etc. in its own '$prefix/$target/bin', but the '$prefix'
is normally common for all the cross-tools and the '$prefix/bin' has the
tools used by the human user with the names '$target-<tool>', for instance
'sh-elf-gcc' ...

 The rules say that binutils and GCC for a target must be configured to
use the same $prefix and $target names. If not, 'make install' puts them
to the wrong '$prefix/$target/bin' for GCC to find them...  Just check
this from your GCC-manual, the section "Installation / Cross-Compiler". 

 When you used prebuilt binutils, libs and headers for the target, you
should have preinstalled them under your chosen '$prefix/$target'.

> We used strace on the problem line, and verified that xgcc was
> searching the path for 'as'.

 If the 'as' for the target is not in the needed '$prefix/$target/bin',
(or in any directory given by './xgcc -print-search-dirs') the 'as' in
the system PATH will be used...

> What are we doing wrong here?

> > /home/dank/sh4-gcc/gcc-build/gcc/xgcc
> > -B/home/dank/sh4-gcc/gcc-build/gcc/
> > -B/opt/hardhat/devkit/sh/sh4_le/sh4-linux/bin/           <---- !
> > -B/opt/hardhat/devkit/sh/sh4_le/sh4-linux/lib/           <---- !
> > -isystem /opt/hardhat/devkit/sh/sh4_le/sh4-linux/include <---- !

 The last three rows show where the binaries, libraries and headers for
the 'sh4-linux' target are sought. So your chosen $prefix for GCC is the:

    /opt/hardhat/devkit/sh/sh4_le

and the chosen $target is the:

    sh4-linux

 So your binutils for the 'sh4-linux' target should be in the shown
'/opt/hardhat/devkit/sh/sh4_le/sh4-linux/bin/' with their base names.
If they aren't there, that is the big problem...

Cheers, Kai


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list