Gentoo Archives: gentoo-user

From: Pandu Poluan <pandu@××××××.info>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] -march=? for this cpu
Date: Tue, 09 Apr 2013 07:01:56
Message-Id: CAA2qdGWhOgdB1Janfok=Sx_VMRkMRBvt5-HjMWukB=e30NApxQ@mail.gmail.com
In Reply to: Re: [gentoo-user] -march=? for this cpu by Michael Hampicke
1 On Apr 9, 2013 1:16 PM, "Michael Hampicke" <gentoo-user@××××.biz> wrote:
2 >
3 > Am 09.04.2013 05:50, schrieb Nilesh Govindrajan:
4 > > I have two Gentoo VMs at Hetzner and the CPU supports 64 bit (grep lm
5 > > /proc/cpuinfo = true).
6 > >
7 > > But something funny, gcc -march=native -mtune=native -v -E - 2>&1
8 > > </dev/null returns this:
9 > >
10 > > Using built-in specs.
11 > > COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3/gcc
12 > >
13 COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/lto-wrapper
14 > > Target: x86_64-pc-linux-gnu
15 > > Configured with:
16 > > /var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/configure
17 > > --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3
18 > > --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include
19 > > --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3
20 > > --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/man
21 > > --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/info
22 > >
23 --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4
24 > > --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
25 > > --disable-fixed-point --without-ppl --without-cloog --enable-lto
26 > > --enable-nls --without-included-gettext --with-system-zlib
27 > > --enable-obsolete --disable-werror --enable-secureplt --enable-multilib
28 > > --enable-libmudflap --disable-libssp --enable-libgomp
29 > > --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/python
30 > > --enable-checking=release --disable-libgcj --enable-libstdcxx-time
31 > > --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix
32 > > --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all
33 > > --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.6.3
34 > > p1.11, pie-0.5.2'
35 > > Thread model: posix
36 > > gcc version 4.6.3 (Gentoo 4.6.3 p1.11, pie-0.5.2)
37 > > COLLECT_GCC_OPTIONS='-march=native' '-mtune=native' '-v' '-E'
38 > > /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1 -E -quiet -v -
39 > > -march=pentium-m -mcx16 -msahf -mno-movbe -mno-aes -mno-pclmul -mpopcnt
40 > > -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mbmi -mno-tbm -mno-avx
41 > > -mno-sse4.2 -mno-sse4.1 --param l1-cache-size=32 --param
42 > > l1-cache-line-size=64 --param l2-cache-size=4096 -mtune=generic
43 > > ignoring nonexistent directory "/usr/local/include"
44 > > ignoring nonexistent directory
45 > >
46 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/include"
47 > >
48 > > #include "..." search starts here:
49 > > #include <...> search starts here:
50 > > /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include
51 > > /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include-fixed
52 > > /usr/include
53 > > End of search list.
54 > > # 1 "<stdin>"
55 > > <stdin>:1:0: error: CPU you selected does not support x86-64 instruction
56 > > set
57 > >
58 > > It is returning pentium-m as architecture, which indeed is 32bit. I'm
59 > > presently running the VM with -march=core2, but this is very weird.
60 > >
61 > > This is the /proc/cpuinfo:
62 > >
63 > > processor : 0
64 > > vendor_id : GenuineIntel
65 > > cpu family : 6
66 > > model : 2
67 > > model name : QEMU Virtual CPU version 1.0
68 > > stepping : 3
69 > > microcode : 0x1
70 > > cpu MHz : 3399.998
71 > > cache size : 4096 KB
72 > > fpu : yes
73 > > fpu_exception : yes
74 > > cpuid level : 4
75 > > wp : yes
76 > > flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca
77 > > cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good nopl pni vmx
78 > > cx16 popcnt hypervisor lahf_lm
79 > > bogomips : 6799.99
80 > > clflush size : 64
81 > > cache_alignment : 64
82 > > address sizes : 40 bits physical, 48 bits virtual
83 > > power management:
84 > >
85 > > Any idea what should be the march/mtune value?
86 > >
87 >
88 > I don't have any experience with Hetzner's VMs - I only use their
89 > dedicated machines :)
90 >
91 > But as a more generic tip, you should install gentoo in VMs only with
92 > generic optimization. You can not safely rely on what CPU your VM will
93 > get. Maybe in 6 months the host your vm is on crashes, and your vm will
94 > be migrated to a new system with totally different cpu (actual hardware
95 > cpu or the cpu configuration that qemu is going to emulate).
96 >
97
98 One tip for me: If your VMs are 64-bit, obviously the underlying CPU must
99 be 64-bit. So, setting -march=nocona should be safe (Nocona is Intel's
100 first AMD64-compatible CPU).
101
102 Rgds,
103 --

Replies

Subject Author
Re: [gentoo-user] -march=? for this cpu Nilesh Govindrajan <me@××××××××.com>