This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Cross compiler, binutils, build
- From: Andrew Haley <aph at redhat dot com>
- To: Hendrik Greving <hendrik dot greving dot intel at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sat, 27 Jul 2013 09:26:15 +0100
- Subject: Re: Cross compiler, binutils, build
- References: <CANc4vhpwqOjOuAKUS6oyi12PyB2oEk2WGoZhECOg1jkoqSW25Q at mail dot gmail dot com>
On 07/27/2013 12:01 AM, Hendrik Greving wrote:
> I am looking at how to best integrate building a cross compiler in our
> source tree, which is a little bit old-baken and easy to break.
> Nevertheless, I'd like to to it like you're supposed to do with new
> GCC's. I am using 4.8.1 now. Rather than describing my specific
> problem, let me ask very general here. What I want is to build
> re-targeted binutils for <myarch> with program-prefix <myarch> and
> program-suffix <version>.
>
> How best to build GCC and tell the built driver to use binutils above
> as well as using this for building libgcc (and bootstrapping)?
>
> ./gcc/configure --prefix=<myprefix>
> --program-prefix=<myarch>-
> --program=suffix=-<myversion>
> --disable-multilib
> --with-ld= DO I NEED THIS
> --with-as= DO I NEED THIS
> --target=<myarch-os>
> --with-newlib --enable-languages=c
> --with-sysroot= DO I NEED THIS?
> --with-build-sysroot= DO I NEED THIS?
>
> What I saw was basically the compiler looking for <myarch-os>-ar while
> building the libgcc library.
Redirect to gcc-help.
It's best to use an integrated tree.
I copy the binutils source subdirs into gcc with a little script (available on
request) then:
/scratch/aarch64/trunk/configure --prefix=/usr/local/aarch64-redhat-linux --target=aarch64-redhat-linux --with-sysroot=/scratch/aarch64/rootfs
That is all. It builds everything: assembler, linker, the whole lot.
There is no better way to do it.
Andrew.