This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Cross-compiling gcc? (sysroot confusion)
- From: Christer Solskogen <christer dot solskogen at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Sat, 01 Nov 2014 01:56:24 +0100
- Subject: Re: Cross-compiling gcc? (sysroot confusion)
- Authentication-results: sourceware.org; auth=none
- References: <20141031185023 dot 473b52b6 at mjolnir dot ossman dot eu> <20141101001837 dot 5f0a4474 at mjolnir dot ossman dot eu>
On 01.11.2014 00:18, Pierre Ossman wrote:
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?
I probably missed that part :-)
So I can build all of glibc with the --without-headers gcc?
Yeap.
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.
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'm not 100% sure, but I don't think you need to specify to disable
multilib on i686)
--
chs