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" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 29 Jul 2013 15:53:15 +0100
- Subject: Re: Cross compiler, binutils, build
- References: <CANc4vhpwqOjOuAKUS6oyi12PyB2oEk2WGoZhECOg1jkoqSW25Q at mail dot gmail dot com> <51F38427 dot 1060002 at redhat dot com> <CANc4vhrbfQ-237Ch3eyj7kai=DpzguTqLMn3B=FjGJZA+aW6Wg at mail dot gmail dot com>
Please don't top-post on the GCC lists.
On 07/29/2013 03:34 PM, Hendrik Greving wrote:
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.
> Can I instruct the build to use binaries like <myarch>-ar-<version>
> for e.g. building libgcc?
Sure, that's what --with-ar does. But I don't know why you'd want to.
Your choice, of course.
Andrew.