Re: Cross-compiling gcc? (sysroot confusion)

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

 



> A lot of stuff is *not* straight forward to cross compile. Coreutils ,for instance, can be a pain.
> 
> Whats the confusion? The final-gcc is pretty straight forward :-)
> 
> I would use something like this:
>  export PATH=/bootstrap/bin:$PATH
>    ./configure --target=i686-pc-linux-gnu --prefix=/bootstrap
>                --with-gmp=/bootstrap --with-mpfr=... --with-mpc=...
>                --with-sysroot=/sysroot
>                --enable-__cxa_atexit
>                --enable-languages=c,c++

I may be explaining things improperly. The above would give me a gcc
that cross compiles from the host system to i686-pc-linux-gnu, right?
Otherwise specifying --with-gmp=/bootstrap seems wrong as that
directory most likely contains x86_64 binaries.

What I want is a gcc that is compiled to run on i686-pc-linux-gnu, with
the glibc from the earlier step, targeting i686-pc-linux-gnu and the
same glibc. Which should also mean that sysroot is / (i.e. "normal")
from its point of view?

In theory, it should be as simple as:

   export PATH=/bootstrap/bin:$PATH
   ./configure --prefix=/usr
               --enable-__cxa_atexit
               --enable-languages=c,c++
   make
   make install DESTDIR=/sysroot

But that would only work if gcc's configure picks up all it's settings
from the tools in /bootstrap/bin, rather than having hard coded
defaults or looking directly at the host system.

So my question is really: will it be this simple, or will I run in to
issues once I hit this step? :)

> 
> (I'm not 100% sure, but I don't think you need to specify to disable multilib on i686)
> 

I'm doing x86_64 in another pass, so I just kept it in there in order
to keep things simple. :)

-- 
Pierre Ossman           Software Development
Cendio AB		http://cendio.com
Teknikringen 8		http://twitter.com/ThinLinc
583 30 Linköping	http://facebook.com/ThinLinc
Phone: +46-13-214600	http://plus.google.com/112509906846170010689

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Attachment: signature.asc
Description: PGP signature


[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