This is the mail archive of the
crossgcc@sourceware.org
mailing list for the crossgcc project.
See the CrossGCC FAQ for lots
more information.
Finalizing the toolchain
- From: Trevor Harmon <trevor at vocaro dot com>
- To: crossgcc at sourceware dot org
- Date: Sun, 19 Feb 2006 11:37:34 -0800
- Subject: Finalizing the toolchain
Karim Yaghmour's book "Building Embedded Linux Systems" has a section
in Chapter 4 about finalizing the toolchain. On page 130, he notes
that some of the executables in the target bin directory (e.g., /opt/
crosstool/gcc-3.4.3-glibc-2.3.3/powerpc-405-linux-gnu/powerpc-440-
linux-gnu/bin) contain both host and target executables. Indeed,
after running crosstool-0.38 to create a PowerPC toolchain on my i386
host, I find that as, ar, gcc, and others in the target bin directory
are i386 binaries, while locale, iconv, and other executables in the
same directory are PowerPC binaries.
Yaghmour doesn't explain why this mix-up occurs, but he says that
it's a problem that should be fixed because:
"Some GNU utilities, including gcc, expect to find some of the other
GNU utilities in [the target bin directory] and will use the host's
utilities if they can't find the target's binaries there. Naturally,
this will result in failed compilations, since the wrong system's
tools are used."
I'm really confused about this. First of all, why is Yaghmour
suggesting that I don't want to use the host utilities? I *want* the
host binaries to run because I'm building on the host, not the
target. After all, that's the whole point of a cross-compiling
toolchain, right?
Furthermore, why is crosstool generating target binaries in the first
place? I'm building on an i386 host, so crosstool should be creating
i386 binaries. The PowerPC binaries that it generates are useless to
me, correct?
And finally, in spite of all this host/target mix-up, why can't these
GNU utilities find the right executables anyway? For instance, if I
run powerpc-440-linux-gnu-gcc, and it wants to call ld, shouldn't it
look for powerpc-440-linux-gnu-ld? Why would it look for ld without
the prefix?
Thanks for any clarification,
Trevor
Attachment:
smime.p7s
Description: S/MIME cryptographic signature