Plan du KiWi
Si vous n'avez pas trouvé votre bonheur dans les liens plus haut, le plan vous montrera les quelques pages “cachées” de ce kiwi !
Warning: THIS PAGE IS FOR SAFE FLAGS ONLY.
We aren't interested in benchmark scores, personal anecdotes, rumors, things your really smart uncle once told you, random -m flags that made your box dispense root beer, or any other discussion or debate. It will be removed. Take it to the talk page or the appropriate forum. Thanks.
Retrieved from “http://gentoo-wiki.com/Safe_Cflags”
Astuce : Pour FreeBSD, si vous voulez des informations sur votre processeur, vous pouvez faire :
#cat /var/run/dmesg.boot | grep CPU
car /proc/cpuinfo n'existe pas sur les *BSD !
These CFLAGS are for gcc 3.x and 4.x. To check your version:
gcc --version
You can see which CPU you have with the following command:
cat /proc/cpuinfo
If you're running Intel, you can also use x86info to get more detailed info about your chip:
emerge -av x86info
This page is for those who don't want to experiment, and want a stable system, but still optimized for their CPU. But remember, by using these flags, binaries from your system might not work on another one with a different CPU. So if you compiled with optimizations for a Pentium 4 (-march=pentium4), you can't share a hard disk or packages with a friend who only has a Pentium MMX (-march=pentium-mmx). Though the other way around should work, see below.
This is the case if you are using the -march flags. If you use -mtune instead without any -march option, your binaries are backward compatible down to i386, but the scheduling is optimized for your choosen architecture. CPUs are also backward compatible so if you update your system with a new CPU you can still use your old packages. There is one exception though; if your old CPU supports a feature, like AMD's 3dnow, that your new CPU doesn't. So if you have an athlon (-march=athlon) and upgrade to a pentium4 your old packages might not work. You can mix -march and -mtune if you, for example, would like to create binaries that would run on any i686 but are optimized for a pentium4. This would be accomplished by using -march=i686 and -mtune=pentium4.
Note that -O2 is regarded as safer than ”-O3”, and ”-O3” can often be a counter-productive attempt at optimization. On computers with limited cache and/or memory, ”-Os” may provide better performance in some cases through smaller binaries, although it is slower when using the OpenSSL library with small keys (DSA keys with less than 2048 bits on VIA C3-2, 1200 MHz and 64 kb on-die cache).
Note: This is only true if the platform has unusually fast unaligned access capability since -Os disables some alignment. A better solution is ”-O2 -fno-reorder-blocks -fno-reorder-functions”
Please note that all the CFLAGS below look like they have a lowercase O. It really is an uppercase O. If you enter a lowercase O in your CFLAGS, then you will break your Portage and you won't be able to install anything. If you see the following error in your emerge output, than it could point to this problem.
checking whether the C compiler works... configure: error: cannot run C compiled programs.
GCC has a number of flags for CPU features like MMX and SSE; -mmx -msse etc. They are implied if you use a correct -march option so you usually don´t need them, with some exceptions. They should not be confused with the similar USE-flags for CPU features. The flag -mfpmath=sse however is not enabled by -march but it usually makes binaries slower due to limitations in the glibc headers. So it's better to not use this flag, even if you have an SSE capable CPU. Also -mfpmath=sse,387 is experimental and unstable.
The flag -fomit-frame-pointer is enabled by default on arches where it doesn't interfere with debugging, such as AMD64. The gcc manual is a bit unclear on which arches -fomit-frame-pointer is actually enabled, but it's not on x86. So if you're on x86 you should add it to your CFLAGS. Also don't use -momit-leaf-frame-pointer together with -fomit-frame-pointer. It's pointless as -fomit-frame-pointer already omits all frame pointers. In fact if you use both, -momit-leaf-frame-pointer overrides -fomit-frame-pointer creating less optimized code.
If you are, or plan on becoming a programmer/developer, then DO NOT use the -fomit-frame-pointer or -O3 flag as this can make debugging impossible, or at least a lot harder (especially on x86 machines).
This is also important if you find a program with a bug in, which you wish to report. Before you submit a bug report, compile with just ”-O2 -march=i686 -pipe” and without ”-fomit-frame-pointer” (see http://bugs.gentoo.org/show_bug.cgi?id=68282 for an explanation.) Basically the frame-pointer is needed for stack traces.
Please do not include any flags that aren't 100% safe. Just because it works for you doesn't mean it will for everyone else.
Note: Gentoo's minimum hardware requirement for x86 CPUs is the i486. This is due to glibc-2.4 dropping linuxthreads support and requiring NPTL which doesn't work on i386.
If you would like to use a newer machine (eg. a Pentium III) to compile code that will still run on i386 machines use the following:
CHOST="i386-pc-linux-gnu"
CFLAGS="-mtune=pentium3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
or
CHOST="i386-pc-linux-gnu"
CFLAGS="-march=i386 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
The former will create code optimized for a PIII that will still run on a i386, while the latter will be optimized for the i386 alone.
CHOST="i486-pc-linux-gnu"
CFLAGS="-march=i486 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : GenuineIntel
cpu family : 5
model : 2
model name : Pentium 75 - 200
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=pentium -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=pentium-mmx -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
CFLAGS="-march=pentium-mmx -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentiumpro -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
or
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
(these are identical)
vendor_id : GenuineIntel
cpu family : 6
model : 3, 5
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium2 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium2 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 6 model name : Mobile Pentium II stepping : 10 cpu MHz : 397.082 cache size : 256 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr bogomips : 794.75 clflush size : 32
vendor_id : GenuineIntel
cpu family : 6
model : 6
stepping : 0
processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 6 model name : Celeron (Mendocino) stepping : 0 cpu MHz : 400.932 cache size : 128 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr up bogomips : 802.49 clflush size : 32
vendor_id : GenuineIntel
cpu family : 6
model : 7, 8
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : GenuineIntel
cpu family : 6
model : 8
stepping : 10
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : GenuineIntel
cpu family : 15
model : 1
model name : Intel(R) Celeron(R) CPU 1.70GHz
stepping : 3
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : GenuineIntel
cpu family : 6
model : 9 or 13
model name : Intel(R) Pentium(R) M processor XXXXMHz
For gcc 3.3 or older:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -msse2 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
For gcc 3.4 and later:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium-m -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
The Celeron M is based on the Pentium M but it has half the L2 cache and does not support the SpeedStep technology.
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Mobile Intel(R) Pentium(R) 4 - M CPU X.XXGHz
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : GenuineIntel
cpu family : 15
model : 0 or 1 or 2
model name : Intel(R) Pentium(R) 4 CPU XXXXMHz
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : GenuineIntel
cpu family : 15
model : 3 or 4
model name : Intel(R) Pentium(R) 4 CPU XXXGHz -or- Intel(R) Celeron(R) CPU XXXGHz
32-bit profile (x86)
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64-bit profile (amd64)
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
Note: You can verify the chip is a Prescott by looking for pni in the flags section of /proc/cpuinfo. This indicates support for SSE3.
In 2004, Intel started branding processors with the Prescott core as Intel Celeron D.
vendor_id : GenuineIntel
cpu family : 15
model : 4, 6
model name : Intel(R) Pentium(R) D CPU x.xxGHz
32-bit profile (x86)
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64-bit profile (amd64)
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Xeon(R) CPU XXXXMHz
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : GenuineIntel
cpu family : 15
model : 4, 6
model name : Intel(R) Xeon(R) CPU XXXXMHz
32-bit profile (x86)
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64-bit profile (amd64)
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : GenuineIntel
cpu family : 6
model : 14
model name : Genuine Intel(R) CPU TXXXX @ XXXGHz
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
Notes:
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 CPU XXXX @ XXXGHz
32 bit profile (x86)
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64 bit profile (amd64)
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CXXFLAGS="${CFLAGS}"
Note:
Note: EPIA is the name of all VIA's mini-ITX and nano-ITX motherboards with onboard VIA processor. Eden is low-power CPU variant, this name itself also does not tell anything about CPU core.
vendor_id : CentaurHauls
cpu family : 6
model : 10
model name : VIA Esther processor 2000MHz
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=i686 -mmmx -msse -msse2 -msse3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
As the C7 has the pni flag in /proc/cpuinfo, it supports SSE3. Search for pni on this page to get the explanation.
vendor_id : CentaurHauls
cpu family : 6
model : 9
model name : VIA Nehemiah
Note: Despite the C5 core name, these processors are marketed as C3s.
GCC 3.3 and earlier
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=i686 -msse -mmmx -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
GCC 3.4 and later
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=c3-2 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
Note: These cores do support the cmov instruction and hence are supported by i686 - and of course c3-2. If you must be compatible with all VIA C3 versions, do not use the settings in this section and instead use the flags in the C3 entry below.
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=c3 -m3dnow -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
Warning: Do not use any stages or packages containing i686 instructions (such as cmov) with the Samuel 2 and Ezra versions of the C3.
The Ezra doesn't have any special instructions that you could optimize for, just consider it a K6-3 - basically a Pentium 2 with 3DNow.
Note: The Mini-ITX EPIA-SP features a VIA C3 Eden processor, even if /proc/cpuinfo answers: model name: VIA Nehemiah
vendor_id : GenuineTMx86
cpu family : 6
model : 4
model name : Transmeta™ Crusoe™ Processor TM5800
stepping : 3
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=i586 -Os -mmmx -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : GenuineTMx86
cpu family : 15
model : 2
model name : Transmeta Efficeon™ Processor TM8000
stepping : 4
CHOST="i686-pc-linux-gnu"
CFLAGS="-mtune=pentium3 -msse2 -O2 -pipe -falign-functions=0 -falign-jumps=0 -falign-loops=0"
CXXFLAGS="${CFLAGS}"
Note: The Efficeon processor will reorder and realign instructions on translating from x86 to VLIW (Very Large Instruction Word), so not aligning functions/jumps/loops will produce smaller executable without any effect on speed.
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=k6 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : AuthenticAMD
cpu family : 5
model : 8
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=k6-2 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
# cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 5 model : 8 model name : AMD-K6(tm) 3D processor stepping : 12 cpu MHz : 451.031 cache size : 64 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr mce cx8 pge mmx syscall 3dnow k6_mtrr up bogomips : 902.84 clflush size : 32
Note: /proc/cpuinfo may be confusing. The model name may say “AMD-K6™ 3D Processor” but it is not a AMD K6-3. Rely on the vendor_id, CPU family, and model number.
Note: If you get “Illegal Instruction” errors on compiles (especially long ones), you may be running into a cooling problem, or worse yet, a Sig11 (segmentation fault/bad ram) problem. Bug #24379 has a discussion about it.
vendor_id : AuthenticAMD
cpu family : 5
model : 10
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=k6-2 -Os -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=k6-3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
From 600 to 900 MHz (these models have a tbird-alike core model)
product: AMD Duron™ Processor version: 6.3.1
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-tbird -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : AuthenticAMD
cpu family : 6
model : 3
model name : AMD Duron™ Processor
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-tbird -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
From 900 to 1300 MHz
The Morgan Durons are based on the Palomino core, and hence can be treated as Athlon XP's.
vendor_id : AuthenticAMD
cpu family : 6
model : 7
model name : AMD Duron™ Processor
stepping : 1
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : AuthenticAMD
cpu family : 6
model : 4 or 2
model name : AMD Athlon(TM)Processor
stepping : 4 or 2
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : AuthenticAMD
cpu family : 6
model : 4
model name : AMD Athlon™ Processor
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-tbird -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : AuthenticAMD
cpu family : 6
model : 8
model name : AMD Athlon™
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
Sempron 2400+ (2000MHz) is also identified as cpu family:6 model:8 model_name:AMD Sempron(TM) 2400+ (256kB cache) The Duron 1800+ is also included in this list.
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-4 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
vendor_id : AuthenticAMD
cpu family : 6
model : 6
stepping : 2
Some CPUs have also been observed with the following:
model : 10
model name : AMD Athlon™ XP 2500+
stepping : 0
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 4 model name : AMD Athlon(tm) processor stepping : 4 cpu MHz : 1333.136 cache size : 256 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr syscall mmxext 3dnowext 3dnow up bogomips : 2668.87 clflush size : 32
# cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 8 model name : AMD Athlon(tm) Prosowwor stepping : 1 cpu MHz : 1396.274 cache size : 256 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mp mmxext 3dnowext 3dnow up ts fid vid bogomips : 2796.80
# cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 8 model name : AMD Geode NX 1750 stepping : 1 cpu MHz : 1400.115 cache size : 256 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mp mmxext 3dnowext 3dnow up ts fid vid bogomips : 2801.55 clflush size : 32
vendor_id : AuthenticAMD
cpu family : 6
model : 10
model name : AMD Sempron™
stepping : 0
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-mp -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
32 bit
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64 bit
cpu family :15
model :4
model name :AMD Athlon™ 64 Processor 3200+
stepping :8
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
# cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 63 model name : AMD Athlon(tm) 64 Processor 3200+ stepping : 2 cpu MHz : 1999.821 cache size : 512 KB fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm bogomips : 4001.79 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttp
vendor_id: AuthenticAMD
cpu family: 15
model: 35 or 43
stepping: 1 or 2
model name: AMD Athlon™ X2 Dual Core Processor
32 bit
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64 bit
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
If you have a newer Athlon64(“Venice” or “San Diego”)/Athlon64-X2(“Manchester” or “Toledo”) (check for pni in cat /proc/cpuinfo) you can also add ”-msse3” to your CFLAGS to enable SSE3 support. Any chip using the 90nm process except for the “Winchester” class Athlon64 supports SSE3.
Also bear in mind that all Athlon64 X2 and Opteron 165, 170, 175, 180, and 185 processors are dual-core CPUs so make sure that you use “MAKEOPTS=”-j3”” in your make.conf. This doesn't affect the code but might reduce compile times.
All socket AM2 processors are SSE3 capable as well.
vendor_id : AuthenticAMD
cpu family : 15
model : 5
model name : AMD Opteron™ Processor 1xx
stepping : 8
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=opteron -O2 -pipe"
CXXFLAGS="${CFLAGS}"
vendor_id : AuthenticAMD
cpu family : 15
model : 5
model name : AMD Opteron™ Processor xxx
stepping : 8
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=opteron -O2 -pipe"
CXXFLAGS="${CFLAGS}"
vendor_id : AuthenticAMD
cpu family : 15
model : 65
model name : Dual-Core AMD Opteron™ Processor 22xx
stepping : 2
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=opteron -O2 -pipe"
CXXFLAGS="${CFLAGS}"
vendor_id : AuthenticAMD
cpu family : 15
model : 44
model name : AMD Sempron™ Processor
Note: The model number may differ.
32 bit (Socket A)
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64 bit
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
64 bit (SSE3 capable)
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -msse3 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
Sempron64 - 32 bit
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=k8 -msse3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
Sempron64 - 64 bit
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -msse3 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
32 bit
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=k8 -msse3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
64 bit
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -msse3 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
SSE3 is called pni in /proc/cpuinfo for this Central Processing Unit.
vendor_id : AuthenticAMD
cpu family : 15
model : 8
model name : Mobile AMD Sempron Processor 2800+
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -msse3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
If you have a Sempron without SSE3 (earlier chips), omit ”-msse3”.
SSE3 is called pni (prescott new instuction) by cpuinfo (cat /proc/cpuinfo).
Check it out, there are many different sempron mobile CPUs on sale, those that work at 1.8GHz are K8 (i.e. AMD SM 3000+), some others, older, aren't yet k8 but they're still k7 so you must specify athlon-xp instead of athlon64, anyway AMD announced in 2006 there will be 64bit Sempron Mobile CPUs so be carefull and pay attention, run a cat /proc/cpuinfo and then ask on AMD forums if you don't know what to do.
The PowerPC 601 CPU is a mixture between POWER and PowerPC architectures and it is a must you specify -mcpu=601 for taking advantage of the POWER part of the processor and do not use unimplemented PowerPC instructions (implementation of both ISAs is incomplete on 601).
CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=601 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
NOTE: Code created with this flags will not run in any other CPU but PowerPC 601, if you want to run on 601 and others use -mcpu=common and code will run in ANY POWER or PowerPC CPU.
CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=603 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=603e -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=604 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=604e -O2 -pipe"
CXXFLAGS="${CFLAGS}"
-Os may be beneficial on older processors (of any kind, not just PowerPCs).
CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=604e -O2 -pipe -fno-strict-aliasing"
CXXFLAGS="${CFLAGS}"
CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=750 -Os -pipe -fno-strict-aliasing"
CXXFLAGS="${CFLAGS}"
Given the smaller cache sizes, and the fact that the L2 cache is off-die on the G3, better performance may be achieved with -Os rather than -O2.
CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=750 -O2 -pipe -fno-strict-aliasing"
CXXFLAGS="${CFLAGS}"
The 750cx offers more L2 cache than its predecessor, and moves it on-die for a performance boost. Better performance may be achieved with -O2.
CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=7400 -O2 -pipe -maltivec -mabi=altivec"
CXXFLAGS="${CFLAGS}"
Note: -O3 is unstable on G4
CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=7450 -O2 -pipe -maltivec -mabi=altivec -fno-strict-aliasing"
CXXFLAGS="${CFLAGS}"
Note: do not use -fsigned-char
Note: -O3 is unstable on G4
Note: -mpowerpc-gfxopt may slow down certain applications - It's already implied by mcpu, please don't enable it, it's useless.
CHOST="powerpc64-unknown-linux-gnu"
CFLAGS="-mcpu=G5 -O2 -pipe -maltivec -mabi=altivec -fno-strict-aliasing"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-Wl,-O1"
Don't use -mcpu=970 it will make the PS3 slower due to the different pipeline (after all it is a CELL B.E and not a G5). GCC 4.3 or SDK 2.1+ is recommended. A second hint: Unlike x86-64 architecture, it is better to use 32bit user land on a PowerPC with a 64bit kernel. The benefit is, that the CPU still has 32 registers (like in 64bit mode) but every context switch requires to save+load only 32 * 4 bytes (instead of 32 * 8 bytes).
CHOST="powerpc64-unknown-linux-gnu"
CFLAGS="-O2 -pipe -mcpu=cell -mabi=altivec"
CXXFLAGS="${CFLAGS}"
LDFLAGS=""
CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-O2 -pipe -fno-strict-aliasing"
CXXFLAGS="${CFLAGS}"
You should check /proc/cpuinfo for the CPU model and then for a correct -mcpu flag on man gcc. If you do not find it, use powerpc.
CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=<flag> -Os -pipe -fno-strict-aliasing"
CXXFLAGS="${CFLAGS}"
CHOST="sparc-unknown-linux-gnu"
CFLAGS="-O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="sparc-unknown-linux-gnu"
CFLAGS="-mcpu=ultrasparc -mtune=ultrasparc -O2 -pipe"
CXXFLAGS="${CFLAGS}"
Be careful! The CHOST for Sparc64 is still “sparc-unknown-linux-gnu”, not “sparc64-”!
CHOST="hppa1.1-unknown-linux-gnu"
CFLAGS="-O2 -pipe -mschedule=7100LC -march=1.1 -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
CHOST="hppa2.0-unknown-linux-gnu"
CFLAGS="-O2 -pipe -mschedule=8000 -march=2.0 -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
CHOST="alpha-unknown-linux-gnu"
CFLAGS="-mcpu=ev56 -mieee -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="alpha-unknown-linux-gnu"
CFLAGS="-mieee -mcpu=ev67 -Wa,-mev6 -O2 -pipe "
CXXFLAGS="${CFLAGS}"
This applies to ev68 (Compaq Alpha DS25) machines too. Without ”-mcpu=ev67 -Wa,-mev6” flags it cannot bootstrap at all.
These files may be interesting if you want to know what does exactly your -march= mean.
| Arch | File Location | Search for |
|---|---|---|
| x86/x86-64 | gcc/config/i386/i386.c | processor_alias_table[] |
| POWER | gcc/config/rs6000/rs6000.c | processor_target_table[] |
| SPARC | gcc/config/sparc/sparc.c | cpu_table[] |
| Alpha | gcc/config/alpha/alpha.c | cpu_table[] |
| HPPA | gcc/config/pa/pa.c | pa_handle_option (size_t code |
| ARM | gcc/config/arm/arm-cores.def |