Gentoo Archives: gentoo-user

From: Kerin Millar <kerframil@×××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Recommendation for CPU type in QEMU?
Date: Thu, 01 Aug 2013 22:14:40
Message-Id: 51FADDC5.8040100@fastmail.co.uk
In Reply to: Re: [gentoo-user] Recommendation for CPU type in QEMU? by Walter Dnes
1 On 01/08/2013 22:38, Walter Dnes wrote:
2 > On Thu, Aug 01, 2013 at 08:41:56AM +0200, Michael Hampicke wrote
3 >
4 >> You can use march=native on your gentoo hosts, that's no problem, as
5 >> long as you don't use it on your guests. That's the hole idea of VMs:
6 >> being able to move the virtual machine to another machine, that might be
7 >> completely different in terms of hardware. The goal is, to be machine
8 >> independent.
9 >
10 > I want to clarify one item, so please pardon me if it looks like I'm
11 > asking the same question over again. Assume that I launch QEMU with
12 > "-cpu core2duo" and set "-march=native" in the guest's make.conf. My
13 > understanding is that the gcc compiler on the guest will see a core2duo,
14 > not the physical i5 cpu on my desktop.
15
16 That's correct. Try running this in the guest:
17
18 gcc -march=native -Q --help=target | grep march | awk '{print $2}'
19
20 >
21 > We may be looking at different ways of doing the same thing. You're
22 > suggesting "-march=core2" in the guest's make.conf. I'm suggesting
23 > "-march=native" in the guest's make.conf, which would pick up the cpu
24 > type that QEMU sets (cor2duo). I'm trying to make things simpler, by
25 > only having to specify the cpu type once, on the QEMU commandline, and
26 > leaving gcc to adapt to the QEMU-specified cpu.
27
28 --Kerin