Gentoo Archives: gentoo-user

From: Andrew Savchenko <bircoph@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] cross-compile attempt
Date: Sun, 31 Jul 2016 20:18:30
Message-Id: 20160731231800.92c4c889c7f91a020bbc4e0d@gentoo.org
In Reply to: [gentoo-user] cross-compile attempt by Mick
1 On Sun, 31 Jul 2016 19:40:37 +0100 Mick wrote:
2 > Hi All,
3 >
4 > I am dipping my toe into cross-compile territory, in order to build i686
5 > binaries for a 32bit box, which is too old to do its own emerges. I am using
6 > an amd64 box which is significantly faster to do all the heavy lifting and
7 > started applying this page:
8 >
9 > https://wiki.gentoo.org/wiki/Embedded_Handbook/General/Creating_a_cross-compiler
10 >
11 > which I followed up with:
12 >
13 > https://wiki.gentoo.org/wiki/Cross_build_environment
14
15 And here comes this misconception again... Please, tell me, why on
16 the earth cross-compiling is needed for amd64 to produce i686
17 binaries?!
18
19 amd64 CPU _natively_ supports x86 instructions, amd64 kernel
20 natively supports x86 code (this can be disabled during kernel
21 config, but usually it isn't), amd64 gcc *can* produce x86 binaries.
22
23 There are two ways to help older x86 boxes to build packages faster:
24
25 1. Set up distcc to produce x86 code on your amd64 processors. Just
26 add -m32 to your *FLAGS.
27
28 2. Copy old box system to a chroot dir on amd64. Run setarch i686
29 and chroot to that directory, and build 32-bit packages as usual!
30 There are two ways to deliver them:
31
32 2.a. Generate binary packages on new box and install them on old
33 boxes.
34
35 2.b. Instead of copying old box's root, mount it over NFS.
36
37 I'm currently using 1, but planning to switch to 2.a, because
38 distcc can't help with everything (execution of java, python,
39 autotools and other stuff can't be helped with distcc).
40
41 I used 2.b earlier on very old box (it is dead now).
42
43 3. Well, one can do full cross-compilation as you proposed, but
44 this is ridiculous. Cross-compilation is always a pain and if it
45 can be avoided, it should be avoided.
46
47 Best regards,
48 Andrew Savchenko

Replies

Subject Author
Re: [gentoo-user] cross-compile attempt Mick <michaelkintzios@×××××.com>