Gentoo Archives: gentoo-embedded

From: Kumba <kumba@g.o>
To: gentoo-embedded@l.g.o
Subject: Re: [gentoo-embedded] Building native arm gcc toolchain
Date: Sat, 25 Jun 2005 03:38:05
Message-Id: 42BCD24D.8040905@gentoo.org
In Reply to: Re: [gentoo-embedded] Building native arm gcc toolchain by Brian Koropoff
1 Brian Koropoff wrote:
2 > As far as I know, crossdev only builds a cross compiler which runs on
3 > your build system but generates executables for another
4 > processor/architecture. I've already used crossdev sucessfully to
5 > generate such a compiler for arm. What I want to do now is build a
6 > compiler that *runs* on arm and creates arm executables (that is, both
7 > the host and target platform is arm, not just the target). This should
8 > be as simple as using portage with my crossdev-built cross-compiler and
9 > emerging it, but the build fails. Is there any trick to getting portage
10 > to build a native gcc to be included in the arm root fs?
11
12 If I'm reading this right, then what you want to do is impossible. You can't
13 build a gcc that runs on arm, and builds for arm, on a cross-host. gcc has a
14 rather strange build phase, wherein it rebuilds itself 2-3 times (if you watch a
15 gcc build closely, you'll see an "xgcc" and references to stage1 and stage2
16 bootstraps). As such, if you want to build a native compiler, you have to build
17 on the native architecture. This is because when the initial bootstrap
18 completes, and gcc kicks off it's stage1 xgcc run, that xgcc is an arm binary,
19 and it tries to build a stage2 xgcc arm binary. If performed on a fast x86 box,
20 this will fail.
21
22
23 --Kumba
24
25 --
26 Gentoo/MIPS Team Lead
27 Gentoo Foundation Board of Trustees
28
29 "Such is oft the course of deeds that move the wheels of the world: small hands
30 do them because they must, while the eyes of the great are elsewhere." --Elrond
31 --
32 gentoo-embedded@g.o mailing list

Replies

Subject Author
Re: [gentoo-embedded] Building native arm gcc toolchain Brian Koropoff <brianhk@×××××××××××××.edu>
Re: [gentoo-embedded] Building native arm gcc toolchain Tommy B <gentoo@×××××.com>