On 31.10.2014 18:50, Pierre Ossman wrote:
Hi,
I'm trying to cross-compile gcc (rather than just creating a
cross-compiling gcc), and I'm not getting a clear picture of how all
the configure flags interact. Rather than spending countless hours with
the trial-and-error approach I'd figured I'd ask for help. :)
In short, what I'd like to achieve is to have a /sysroot that I can
chroot into and have a fully functional gcc. I have a working method
for that, but it's very convoluted and high-maintenance. There must be
a simpler way. This is my current theorised plan on how to reach that:
You are doing several things wrong.
First off - Keep the cross compiler and cross binutils *out* of
/sysroot. Install them somewhere else. That includes gmp, mpfr and mpc.
The easiest way (imho) is to create /cross where you install all of
those. I would also recommend to install gmp,mpfr and mpc with static
only. *Or* if you have root access, just use the ones that come with
your distribution.
You only need to compile (cross) binutils once, include the sysroot
setting.
This is the way: cross-binutils -> cross-gcc-staging -> kernel headers
-> glibc (which you cross compile) -> cross-gcc-final. Install glibc
into sysroot.
When that is done, you can cross compile gmp,mpc,mpfr,binutils and gcc
and install them into /sysroot.
But in order to have a sysroot you can chroot into you will also need a
lot of other stuff like sed,gawk,grep, coreutils etc. Or(!) you can
install busybox.
You might also want to take a look at proot(http://proot.me).
At last: Use the most current compiler.
--
chs