Gentoo Archives: gentoo-user

From: Mark Knecht <markknecht@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] CFlags for CPU
Date: Tue, 26 Jul 2011 19:01:46
Message-Id: CAK2H+edS71xQmLooSGGWTSh4HxhZG1HcniziZb5LQUQwzZkavA@mail.gmail.com
In Reply to: [gentoo-user] CFlags for CPU by Alokat
1 On Tue, Jul 26, 2011 at 1:36 PM, Alokat <mailing@××××××.org> wrote:
2 > Hi folks,
3 >
4 > I'm wondering what kind of cpu-type I should use?
5 >
6 > cat /proc/cpuinfo
7 > ..............
8 >
9 > processor       : 1
10 > vendor_id       : GenuineIntel
11 > cpu family      : 6
12 > model           : 15
13 > model name      : Intel(R) Core(TM)2 Duo CPU     L7100  @ 1.20GHz
14 > stepping        : 11
15 > cpu MHz         : 1197.065
16 > cache size      : 4096 KB
17 > physical id     : 0
18 > siblings        : 2
19 > core id         : 1
20 > cpu cores       : 2
21 > apicid          : 1
22 > initial apicid  : 1
23 > fpu             : yes
24 > fpu_exception   : yes
25 > cpuid level     : 10
26 > wp              : yes
27 > flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
28 > cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm
29 > constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64
30 > monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida dts tpr_shadow
31 > vnmi flexpriority
32 > bogomips        : 2394.01
33 > clflush size    : 64
34 > cache_alignment : 64
35 > address sizes   : 36 bits physical, 48 bits virtual
36 > power management:
37 >
38 > ..............
39 >
40 > After a short research on this website:
41 > http://gcc.gnu.org/onlinedocs/gcc-4.6.1/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
42 >
43 > I guess core2 is the right one?
44 > Is that true?
45 >
46 > Regards,
47 > alokat
48 >
49
50 Or let gcc figure it out using
51
52 -march=native
53
54 which is what I eventually did:
55
56 # Please consult /usr/share/portage/config/make.conf.example for a more
57 # detailed example.
58 CFLAGS="-O2 -march=native -pipe"
59 #Safe CFlags for the Core-i7 (web info) saved for reference
60 #CFLAGS="-march=core2 -msse4 -mcx16 -msahf -O2 -pipe"
61 CXXFLAGS="${CFLAGS}"
62 # WARNING: Changing your CHOST is not something that should be done lightly.
63 # Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
64 CHOST="x86_64-pc-linux-gnu"
65
66
67 HTH,
68 Mark