Gentoo Archives: gentoo-user

From: Florian Philipp <lists@×××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] "universal" CFLAGS/CXXFLAGS/CHOST for 64bit (AMD64 & EMT64T)?
Date: Sat, 11 Jun 2011 19:04:41
Message-Id: 4DF3B1D2.5060909@binarywings.net
In Reply to: [gentoo-user] "universal" CFLAGS/CXXFLAGS/CHOST for 64bit (AMD64 & EMT64T)? by Jarry
1 Am 11.06.2011 17:25, schrieb Jarry:
2 > Hi,
3 > how should I change/set CFLAGS/CXXFLAGS/CHOST if I want to have
4 > system which can be easily migrated between AMD64 and Intel/Core
5 > without recompilation? I have a few virtual servers which I can
6 > not move from one arch to the other, as they have hw-specific
7 > CFLAGS (different host-server hardware, both AMD64 and EM64T):
8 >
9 > I have systems with Athlon64/X2 and Core2Quad, with settings:
10 > CFLAGS="-march=athlon64 -O2 -pipe"
11 > CFLAGS="-march=core2 -O2 -pipe"
12 > CHOST is always "x86_64-pc-linux-gnu".
13 >
14 > I'm not sure "-mtune=generic" is the right solution, because
15 > it would generate code for IA32/AMD64/EM64T (if I understand
16 > gcc manual correctly, for both 32bit as well as 64bit HW).
17 >
18 > What I'm looking for are some generic 64bit settings only for
19 > AMD64/EM64T (not 32bit/IA32) similar as for distros with binary
20 > distributions (i.e. I can download Ubuntu either 32bit or 64bit
21 > version, no other hardware-specific difference). I know with
22 > "universal" 64bit binaries I'm going to loose some pefrormance,
23 > but for me flexibility with migration would overweight this
24 > disadvantage...
25 >
26 > Jarry
27 >
28
29 Unless you specify -m32, your x86_64 gcc will create generic x86_64
30 code. That means it will use the common AMD64/EM64T instruction set
31 which also includes SSE2 instructions.
32
33 Regards,
34 Florian Philipp

Attachments

File name MIME type
signature.asc application/pgp-signature