Gentoo Archives: gentoo-user

From: Nikos Chantziaras <realnc@×××××.de>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Compiling 32 bit library on x86_64
Date: Fri, 30 Apr 2010 14:04:12
Message-Id: hrekq7$o97$1@dough.gmane.org
In Reply to: Re: [gentoo-user] Compiling 32 bit library on x86_64 by David W Noon
1 On 04/30/2010 03:09 PM, David W Noon wrote:
2 > On Fri, 30 Apr 2010 12:10:02 +0200, Roger Mason wrote about
3 > [gentoo-user] Compiling 32 bit library on x86_64:
4 >
5 >> Hello,
6 >>
7 >> I need to compile a 32 bit version of libtermcap on an x86_64
8 >> (multilib) system. Can someone tell me how to set up CFLAGS? This is
9 >> what I have at the moment:
10 >>
11 >> CFLAGS="-O2 -m32 -march=native -msse3 -pipe"
12 >> CXXFLAGS="-O2 -m32 -march=native -msse3 -pipe"
13 >
14 > The -march=native will shoot you in the foot. Pick a 32-bit
15 > architecture and use that instead; e.g. -march=i686
16 >
17 > Then, -msse3 could also be problematic, unless the target is a very late
18 > model Pentium 4. I would ditch that too.
19
20 None of those options are problematic. -march=native has nothing to do
21 with 32/64 bit. Every 64-bit CPU is 32-bit compatible and has zero
22 consequence.
23
24 I think you fell into the logical trap that 32-bit CPUs are not 64-bit
25 compatible but it's OK vice versa :) Meaning you can't use "-m64
26 -march=i686". But you *can* and *should* use "-m32 -march=core2".