Re: building native cross compiler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Zintakis <michael.zintakis@xxxxxxxxxxxxxx> writes:

> 3. then use GCC 1 to build GCC 2 and its toolchain (single stage,
> bootstrap disabled) which is for --host=x86_64 and target= either
> powerpc or i586/i686 (depending on the scenario I would need either of
> these architectures, but not both, hence this is one compiler with
> different cross-tool chains depending on the need I have). For this I
> guess I just need to run configure with the appropriate options
> (including --disable-bootstrap) and then make to finish the job.

Yes.  You can not bootstrap this compiler.  gcc will know that and so
--disable-bootstrap will be the default.

> 4. use GCC 2 to build GCC 3 which would form part of the target
> software system allowing compilation of software for the target
> architecture only. I am still unclear as to whether I need to (or
> should!) use the 3-stage or single-stage path for this compiler.

You must use the single-stage path here because no other path will work.
You can not bootstrap a compiler which does not run on the build system.

> True, but if I need a compiler able to build on host=x86_64 and
> target=powerpc that's one (cross) compiler isn't it, I don't need to
> run the build process twice for that, do I or have I got this wrong?

Yes, that is one cross-compiler.

>>> GCC No 2 (single-stage, no bootstrap?) would have to be also x86_64
>>> and have libraries and tools built for both arches (cross-compilation)
>>> - 
>>> x86_64 and powerpc.
>>>     
>>
>> This is two compilers.  Both have use x86_64 as the host and build
>> environment, and use the appropriate target as the target environment.
>>   
> So, if I want a cross compiler which is x86_64 and cross-compiles for
> ppc is that one or two compilers (and chain tools) I need to build? I
> am confused now!

If I'm following you, you have one "GCC No 2 compiler" for the i586/i686
target, and you have one for the PPC target.  I just wanted to make
clear that you can't have a single compiler which targets all of
i586/i686/PPC.


>>> GCC No 3 would have to be powerpc only and have the libraries and
>>> tools for that arch only.
>>>     
>>
>> Yes, I guess so, though I'm not sure what happened to the other target.
>>   
> The two possible scenarios are
>
> x86_64 (GCC1) -> x86_64 (GCC2) -> powerpc (GCC3) or
> x86_64 (GCC1) -> x86_64 (GCC2) -> i586/i686 (GCC3)
>
> So, I would need three compilers for the above, the second one (GCC2)
> being the most tricky as it needs to be able to use the power of the
> host system (x86_64) in order to build either powerpc or i586/i686
> code - all in chroot-ed environment. Well, at least that is my take on
> it.

You can't really describe these compilers using single names.  I would
say you have

x86_64-native (GCC1) -> x86_64-x-powerpc (GCC2) -> powerpc-native (GCC3)
x86_64-native (GCC1) -> x86_64-x-i586/i686 (GCC2) -> i586/i686-native (GCC3)


>>> Is that correct? If so, what process needs to be followed for building
>>> GCC No 3 - 3-stage bootstrap or a single-stage and bootstrap disabled?
>>>     
>>
>> For stage 3 build is x86_64 and host and target are both PPC or whatever.
>>   
> I still don't understand? Should I enable bootstrap (and the 3-stage
> build) when I run configure for GCC3 (which would only need to compile
> code for the target architecture and nothing more, though it needs to
> have the toolchain built for that architecture as well)?

You can't bootstrap or 3-stage gcc3, because the compiler you are
building can not run on the build system.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux