This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: building native cross compiler


Thank you Ian - it is much clearer to me now. Further comments below!

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.
Correct - your (extended) schematics below describe perfectly what I had in mind. I actually have two very different scenarios for which I have to prepare. GCC2 will have to compile either i586/i686 or ppc (using the - native - x86_64 environment) but not both!

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)
Yep, that is *exactly* what I had in mind. The target systems could be of two different types and are two, completely different scenarios.

OK, speculating a bit and expanding this further with two more queries - if I do not know the target system in advance (i.e. the target for GCC2) but this target is specified when the whole build process is initiated, would the procedure we discussed on this thread differ?

In other words, if, via a command line parameter or some environment variable, the target system is specified when the build up process is initiated and is, say, m68, and if I follow the process as discussed on this thread, i.e.:- 1) build GCC1 (native-3stage-x86_64), then 2) build x86_64-x-m68 (GCC2), then 3) build m68-native (GCC3), 4) use GCC2 to compile the rest of the software for native m68 environment and 5) prepare the image file for installation. Would that be the right path to follow (i.e. same process but for different target system)?

And my second (speculative) query - would it be wise to skip the first step in this process (building GCC1) and build GCC2 instead and continue the path from there? What would be the implications if such path is to be followed (if at all possible that is)?

MZ


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]