Gentoo Archives: gentoo-embedded

From: Brian Koropoff <brianhk@×××××××××××××.edu>
To: gentoo-embedded@l.g.o
Subject: Re: [gentoo-embedded] Building native arm gcc toolchain
Date: Sat, 25 Jun 2005 03:56:34
Message-Id: 42BCD88C.9080708@cs.washington.edu
In Reply to: Re: [gentoo-embedded] Building native arm gcc toolchain by Kumba
1 Kumba wrote:
2
3 > Brian Koropoff wrote:
4 >
5 >> As far as I know, crossdev only builds a cross compiler which runs on
6 >> your build system but generates executables for another
7 >> processor/architecture. I've already used crossdev sucessfully to
8 >> generate such a compiler for arm. What I want to do now is build a
9 >> compiler that *runs* on arm and creates arm executables (that is, both
10 >> the host and target platform is arm, not just the target). This should
11 >> be as simple as using portage with my crossdev-built cross-compiler and
12 >> emerging it, but the build fails. Is there any trick to getting portage
13 >> to build a native gcc to be included in the arm root fs?
14 >
15 >
16 > If I'm reading this right, then what you want to do is impossible.
17 > You can't build a gcc that runs on arm, and builds for arm, on a
18 > cross-host. gcc has a rather strange build phase, wherein it rebuilds
19 > itself 2-3 times (if you watch a gcc build closely, you'll see an
20 > "xgcc" and references to stage1 and stage2 bootstraps). As such, if
21 > you want to build a native compiler, you have to build on the native
22 > architecture. This is because when the initial bootstrap completes,
23 > and gcc kicks off it's stage1 xgcc run, that xgcc is an arm binary,
24 > and it tries to build a stage2 xgcc arm binary. If performed on a
25 > fast x86 box, this will fail.
26 >
27 >
28 > --Kumba
29 >
30 Are you sure it's impossible? In order to build a compiler on the
31 native architecture, I'll need a compiler that runs on arm to perform
32 the compilation. However, getting a compiler that runs on arm is what
33 I'm trying to do in the first place! The stage tarballs must contain a
34 complete native compiler toolchain so that a gentoo system can be
35 bootstrapped and built. I assume the gentoo devs are building stage
36 tarballs for arm entirely with portage on a fast x86 build machine. I'm
37 wondering if there is some trick to it that I'm missing. Please correct
38 me if I'm wrong about this.
39
40 -- Brian Koropoff
41 --
42 gentoo-embedded@g.o mailing list