Cross-compiling gcc? (sysroot confusion)

Pierre Ossman ossman@cendio.se
Fri Oct 31 23:18:00 GMT 2014


> 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.
> 

But I was keeping them out of /sysroot. I was putting the tools
in /bootstrap. So I'm not sure what you're suggesting here?

> 
> You only need to compile (cross) binutils once, include the sysroot setting.
> 

Ok. That saves me a step.

> 
> This is the way: cross-binutils -> cross-gcc-staging -> kernel headers -> glibc (which you cross compile) -> cross-gcc-final. Install glibc into sysroot.
> 

So I can build all of glibc with the --without-headers gcc?

> 
> 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.
> 

Of course. I left those out as they are fairly straight forward
applications to cross compile. It's gcc that's the cause of concern as
it looks in more detail at the build system. But what about the
specifics of building gcc? What configure flags to I need to specify?
That's my primary source of confusion.


Rgds
-- 
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?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20141031/04f5b38c/attachment-0001.sig>


More information about the Gcc-help mailing list