Re: Cross-compiler builds but results fail in crt1.o ...?

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

 



13.4.2012 2:05, Paul Smith kirjoitti:
Hi all.

I've created a cross-compiler environment that appears to work well for
the most part, but clearly there's something not right with it.  I've
poked and prodded it for a while but I can't come up with anything.

I'm running the compiler on GNU/Linux Intel and my cross-environment is
also GNU/Linux Intel, but a different version.  I have built the
compiler using a Canadian cross procedure, where the host is GNU/Linux
RHEL5 Intel 32bit and the target is a generic GNU/Linux Intel system,
supporting both 32 and 64bit output.

Not so clearly told but I understood the target being some totally
self-made ("generic") Linux/x86_64 system, not any distro like RHEL6
mentioned later...

So you have a cross GCC made for RHEL5 host and targeting to a totally
self-made Linux/x86_64 system?

When I run the compiler I'm using --sysroot pointing at a Red Hat EL 6
sysroot containing both 32bit and 64bit libraries in typical multilib
config.

But instead of the "generic/self-made" glibc for your own Linux/x86_64
you use the glibc(s) made for RHEL6 ? This decision is really odd!

The principle in a normal cross GCC is very simple :

- one produces GNU binutils and GCC hosted (--host=) for the required
  $host and targeted (--target=) for the required $target, pointing to
  the place of the installed target libraries, $sysroot, via
  '--with-sysroot=' in their configure

- one uses the existing base C library (in this case glibc) made for
  the $target system, installed into the chosen $sysroot, with all the
  other existing target libraries, X11, Gnome etc made for the $target

So in a "totally self-made generic" Linux target case one needs to
produce those target libraries and copy their shared/runtime parts onto
the target system somehow. There are alternate methods to "bootstrap",
totally dependent on the builder's attitudes against pre-made stuff,
using what is allowed and what is not, quite equivalent to meat-eating,
is eating fish allowed or not, and so on... The prerequisite for an
existing base target C library during GCC build in a system target case
(native GCC possible and the default GCC type) seems to be a hard place
for the "vegetarians" :-)

In a Linux distro target case one only builds binutils and GCC and maybe
also GDB for the target and uses the distro's own pre-made target
libraries copied into the $sysroot, not reproducing any of them!  Of
course all the "extra" target libraries made during the GCC build will
be installed but into the GCC's own search paths (--prefix=), not into
the $sysroot...

Here were the instructions for build the compiler "correctly".  If one
does things this way, everything should work always!

In reality many people will trust in "backwards compatability", so if
there are more than one $target one wishes the crosstoolchain to produce
apps for, one uses the "least common nominator" as the chosen $target.
For instance for making apps for RHEL5 and RHEL6 one would use a crosstoolchain made for RHEL5 target and expect the produced apps to
run perfectly also on RHEL6...


[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