public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* building native cross compiler
@ 2011-03-11 14:56 Michael Zintakis
  2011-03-11 16:00 ` Ian Lance Taylor
  0 siblings, 1 reply; 40+ messages in thread
From: Michael Zintakis @ 2011-03-11 14:56 UTC (permalink / raw)
  To: gcc-help

I have a bit of a conundrum - I am trying to build native cross compiler 
which allows me to compile software which is able to run on 3 platforms: 
x86_64, i585(i686) and powerpc (G2).

The host environment is x86_64, though as native compiler it should not 
use anything from that environment when compiling the software, or at 
least I would like to avoid that as much as possible. One other thing of 
note is that during the software-building process the whole environment 
will be chroot-ed. In the complete image file when the software is built 
there should also be natively-built GCC compiler for the target 
environment (i586/i686 and powerpc).

This used to be pretty straight-forward when host and target platforms 
are the same (3-stage bootstrap, chroot to the target environment image 
and then use the freshly-built GCC to compile the rest of the software), 
but I now have the new task of getting a native cross-compiler built to 
take advantage of the processing power in the host environment, which is 
x86_64 (quad core CPUs).

I have read the help pages (http://gcc.gnu.org/install/build.html) and 
particularly the 2 sections "Building a native compiler" and "Building a 
cross compiler", but there are things in it which aren't very clear to me.

The "Building a cross compiler" section suggests that 3-stage 
bootstrapping is not possible and recommends building and installing 
(presumably in the chrooted environment) a native compiler which is then 
used to build the cross compiler (at least that is my interpretation of 
this).

1. Does that mean that I should follow the steps in the previous section 
("Building a native compiler"), use the 3-stage bootstrapping and after 
this use the resulting compiler to build another GCC cross compiler 
(including the appropriate toolchain) for the 3 architectures I am 
interested in and use this compiler to build my software?

2.  I am also assuming that the native GCC compiler which builds the 
native cross-compiler needs to be for the host environment (x86_64) or 
have I got this wrong?

3. If that is the case what steps should I use to build the GCC compiler 
for the target image architectures (powerpc and i586/i686)?

4. Further in that section ("Building a cross compiler") there is 
reference in it which advices that after building the native compiler I 
should configure the cross compiler and then issue 'make' which will 
automatically build the 'host' tools (host as in the 'host' 
architecture?!) necessary to build the compiler as well as the 'target' 
tools for use of the compiler (again, I assume target as in the 'target' 
architectures I am interested in), then build the compiler itself 
(single-stage only) and "Build runtime libraries using the compiler from 
the previous step". That last bit isn't completely clear to me - what 
previous step?

5. I assume at the end of this process I will end up with my native 
cross compiler which I could then use to build my software. Do I need to 
do anything else?

6. Also, later in that section I am advised that for building the 
binutils (which I would need to anyway!) I need to use the same --host 
and --target that are used for configuring GCC, but which one - the 
native cross-compiling GCC or the one that helped build it?


Many thanks in advance for any guidance with regards to this!


MZ

^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2011-03-20 15:48 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-11 14:56 building native cross compiler Michael Zintakis
2011-03-11 16:00 ` Ian Lance Taylor
2011-03-11 16:56   ` Michael Zintakis
2011-03-11 18:57     ` Ian Lance Taylor
2011-03-11 20:47       ` Michael Zintakis
2011-03-11 21:21         ` Ian Lance Taylor
2011-03-11 23:44           ` Michael Zintakis
2011-03-12  0:06             ` Ian Lance Taylor
2011-03-13 14:23               ` Michael Zintakis
2011-03-13 18:45                 ` Ian Lance Taylor
2011-03-13 22:10                   ` Michael Zintakis
2011-03-14  0:34                     ` Ian Lance Taylor
2011-03-14  0:51                       ` Michael Zintakis
2011-03-14  1:01                         ` Ian Lance Taylor
2011-03-14  1:30                           ` Michael Zintakis
2011-03-14  1:39                             ` Ian Lance Taylor
2011-03-14  1:47                               ` Michael Zintakis
2011-03-14  1:55                                 ` Michael Zintakis
2011-03-14  2:01                                   ` Ian Lance Taylor
2011-03-14  2:08                                     ` Michael Zintakis
2011-03-14  3:48                                     ` Michael Zintakis
2011-03-14 15:26                                       ` Ian Lance Taylor
2011-03-14 15:49                                         ` Michael Zintakis
2011-03-14 16:00                                           ` Michael Zintakis
2011-03-14 16:25                                             ` Ian Lance Taylor
2011-03-14 16:34                                               ` Michael Zintakis
2011-03-14 16:02                                           ` Ian Lance Taylor
2011-03-14 16:31                                             ` Michael Zintakis
2011-03-14 17:23                                               ` Kai Ruottu
2011-03-14 18:03                                                 ` Michael Zintakis
2011-03-14 19:07                                                   ` Kai Ruottu
2011-03-14 19:25                                                     ` Michael Zintakis
2011-03-14 20:20                                               ` Ian Lance Taylor
2011-03-14 20:35                                                 ` Michael Zintakis
2011-03-14 21:12                                                   ` Ian Lance Taylor
2011-03-15  2:25                                                     ` Michael Zintakis
2011-03-15  4:23                                                       ` Ian Lance Taylor
2011-03-15  5:01                                                         ` Mick McCreath
2011-03-16 17:26                                                           ` Michael Zintakis
2011-03-20 15:48                                                           ` Michael Zintakis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).