Re: Bug with cross builds?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kai Henningsen <kai.extern@xxxxxxxxx> writes:

> When building a cross compiler, gcc gets installed at least twice,
> once as $prefix/bin/$target-gcc (long) and once as
> $prefix/$target/bin/gcc (short name), with byte-for-byte identical
> executables.

This is normal.

> There does not seem to b a problem with the long-name variant.
> However, the short-name variant cannot seem to find it's own
> components (cc1, -lgcc, and so on).

This is normal.

> I seem to recall that this used to
> work (and that compiling something for target was easiest done
> prepending $prefix/$target/bin to $PATH and then configuring and
> building as if non-cross).

No.  The binaries in $prefix/$target/bin are not expected to work and
you should not put that directory on your PATH.  It's possible that from
time to time they do work, but that is not guaranteed.

That directory and those files exist so that gcc can reinvoke itself in
certain unusual cases under a known name.  When it does reinvoke itself,
it passes the environment variables and command line options required to
make everything work correctly.

(The cases where gcc reinvokes itself are when it needs to compile code
at link time, as is required for global constructor/destructors on
certain targets and for template instantiation when using -frepo in some
cases.)

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux