Gentoo Archives: gentoo-user

From: meino.cramer@×××.de
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: How to compile for less bits :)
Date: Wed, 29 Sep 2010 18:07:23
Message-Id: 20100929171918.GA5521@solfire
In Reply to: [gentoo-user] Re: How to compile for less bits :) by Grant Edwards
1 Grant Edwards <grant.b.edwards@×××××.com> [10-09-27 21:16]:
2 > On 2010-09-27, meino.cramer@×××.de <meino.cramer@×××.de> wrote:
3 >
4 > > For my microcontroller board (ATMEL AT81RM920, linux based)
5 >
6 > Do you mean AT91RM9200?
7 >
8 > > I want to crosscompile kernels and applications on my 64bit Gentoo
9 > > linux.
10 >
11 > That's easy enough.
12 >
13 > > The source of a gcc (prepared on a 32bit system I fear) for
14 > > the purpose of crosscompiling from a 32bit system-- target is the
15 > > above mentioned processor -- is available.
16 > >
17 > > Is it possible to compile this gcc as a 32bit-application on my 64bit
18 > > system to ensure the same behaviour as it would if to was built on a
19 > > "original 32bit Gentoo Linux"?
20 >
21 > You want to compile gcc on an AMD64 machine and end up with a
22 > cross-compiler that runs as an IA32 app and generates code for an ARM9
23 > target?
24 >
25 > That's called a "Canadian Cross", and is rather tricky, since it
26 > involves three different architectures: building a compiler on
27 > architecture A (AMD64) to be run on architecture B (IA32) and generate
28 > code for architecture C (ARM9).
29 >
30 > Can you explain why you want that rather than a normal cross compiler?
31 >
32 > IOW, why do you want to build a gcc cross compiler that runs as a
33 > 32-bit application? It's _way_ simpler to build a "normal" cross
34 > compiler: building a compiler one architecture (AMD64) to be run on
35 > that same architecture (AMD64) and generate code for a second
36 > architecture (ARM9).
37 >
38 > > (And in this context: The audio application "chuck" is only as 32bit
39 > > application available currently. How is it possible to compile this
40 > > on a 64bit system?)
41 >
42 > You use a compiler that generates code for a the desired 32-bit
43 > architecture. The "width" of the host is immaterial.
44 >
45 > The easiest way to build such a compiler is using crosstool-ng
46 >
47 > http://ymorin.is-a-geek.org/projects/crosstool
48 >
49 > Crosstool-NG does have some support for doing a Canadian-cross, but I
50 > don't see why you would want to do that.
51 >
52 > --
53 > Grant Edwards grant.b.edwards Yow! Gibble, Gobble, we
54 > at ACCEPT YOU ...
55 > gmail.com
56 >
57 >
58
59 Hi Grant,
60
61 Thank you very much for your offered help!
62
63 Sorry, sorry I think my English confused a lot of infos...
64
65 I'll try it again.
66
67 Setup BEFORE I switched to 64bit Gentoo Linux.
68 * a "normal" system gcc as installed by emerge usually on many (all?) gentoo
69 systems...
70 * a "crosscompiling" gcc in source form. Compiled with the "normal"
71 gcc to an executable which runs on the 32bit Gentoo system and
72 produces executables/kernel to run on the ATMEL AT91RM9200 (yes,
73 you're right - this typo was mine ;) ) .
74 * Additional "chuck" audio application only available for 32bit
75 Linux, also compiled with the "normal" gcc
76
77 Wanted setup on my shiny new 64bit Gentoo Linux:
78 * a "normal" system gcc as installed by emerge usually on many (all?) gentoo
79 systems... (==> already there and living quite well)
80 * a "crosscompiling" gcc in source form. To be Compiled with the "normal"
81 gcc to an executable which runs on the 64bit Gentoo system and
82 produces executables/kernel to run on the ATMEL AT91RM9200 (yes,
83 you're right - this typo was mine ;) ) .
84 OR: compiled to be an 32bit gcc-executable which generate executable
85 binaries for my ATMEL cookie.
86 As long a 64bit-executable of gcc can do the job I would prefer that
87 solution of course.
88 * Additional "chuck" audio application only available for 32bit
89 Linux, to be compiled with the "normal" gcc to be a 32 bit
90 executable since not 64bit-ready.
91
92 I hope not to have made too much knots into that above...
93
94 Best regards
95 mcc

Replies

Subject Author
[gentoo-user] Re: How to compile for less bits :) Grant Edwards <grant.b.edwards@×××××.com>