This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Cross compiler, binutils, build
- From: Hendrik Greving <hendrik dot greving dot intel at gmail dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 29 Jul 2013 07:34:26 -0700
- Subject: Re: Cross compiler, binutils, build
- References: <CANc4vhpwqOjOuAKUS6oyi12PyB2oEk2WGoZhECOg1jkoqSW25Q at mail dot gmail dot com> <51F38427 dot 1060002 at redhat dot com>
Can I instruct the build to use binaries like <myarch>-ar-<version>
for e.g. building libgcc?
On Sat, Jul 27, 2013 at 1:26 AM, Andrew Haley <aph@redhat.com> wrote:
> 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.
>