Gentoo Archives: gentoo-user

From: Walter Dnes <waltdnes@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Will a 64-bit-no-multilib machine cross-compile 32-bit code?
Date: Thu, 19 Mar 2015 04:20:45
Message-Id: 20150319042026.GA7681@waltdnes.org
In Reply to: Re: [gentoo-user] Will a 64-bit-no-multilib machine cross-compile 32-bit code? by Fernando Rodriguez
1 On Wed, Mar 18, 2015 at 10:27:05PM -0400, Fernando Rodriguez wrote
2 > On Wednesday, March 18, 2015 9:56:12 PM Walter Dnes wrote:
3 > > My situation...
4 > >
5 > > * I've dug up my ancient netbook, and got Gentoo re-installed on it
6 > > * The cpu is a dual-core Intel(R) Atom(TM) CPU Z520
7 > > * It's 32-bit only; YES!
8 > > * Compiling just the Seamonkey binary (ignoring its dependancies) took
9 > > 14 hours
10 > >
11 > > I obviously want to offload compiling to another machine. As per the
12 > > subject, will a 64-bit no-multilb install be able to cross compile
13 > > 32-bit code?
14 >
15 > I've done it with distcc by adding the -m32 option to cflags. I used a script
16 > (named after the compiler on the gentoo box) to call the compiler with the -
17 > m32 flag and placed on the PATH environment (just for the distccd service)
18 > before anything else and it worked. I got a 64 bit arch box to compile for a
19 > 32 bit gentoo (not nearly as fast as compiling locally on the arch box but
20 > much faster than the gentoo box). It should work similarly with other cross-
21 > compile scenarios.
22
23 Thanks. I'll probably be back with a bunch of questions. As a matter
24 of fact, I already have one. The docs say that it does not work if the
25 "-march=native" cflag is used. It says to use the output of...
26
27 gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
28
29 ...omitting "/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.3/cc1 -E -quiet -v -"
30 I presume. So on the 64-bit host, I would go from...
31
32 CFLAGS="-O2 -march=native -mfpmath=sse -fomit-frame-pointer -pipe -fno-unwind-tables -fno-asynchronous-unwind-tables"
33
34 ...to...
35
36 CFLAGS="-O2 -march=core2 -mcx16 -msahf -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=core2 -fstack-protector -mfpmath=sse -fomit-frame-pointer -pipe -fno-unwind-tables -fno-asynchronous-unwind-tables"
37
38 And on the target (netbook), I'd go to...
39
40 CFLAGS="-O2 -march=atom -mno-cx16 -msahf -mmovbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt --param l1-cache-size=24 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=atom -fstack-protector -mfpmath=sse -fomit-frame-pointer -pipe -fno-unwind-tables -fno-asynchronous-unwind-tables"
41
42 Is that correct (assuming that's my output)?
43
44 --
45 Walter Dnes <waltdnes@××××××××.org>
46 I don't run "desktop environments"; I run useful applications

Replies

Subject Author
Re: [gentoo-user] Will a 64-bit-no-multilib machine cross-compile 32-bit code? Fernando Rodriguez <frodriguez.developer@×××××××.com>
Re: [gentoo-user] Will a 64-bit-no-multilib machine cross-compile 32-bit code? Mike Gilbert <floppym@g.o>