Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Compile binaries in GUEST for HOST machine?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Emon_Gentoo
n00b
n00b


Joined: 10 Feb 2016
Posts: 9

PostPosted: Thu Feb 11, 2016 5:53 am    Post subject: Compile binaries in GUEST for HOST machine? Reply with quote

Hi everyone

I am very new to Gentoo, and I have actually posted this issue in another forum (more on that later), but I wanted to hear from people at his forum. I hope it is OK.

I have been playing around with Gentoo_x64 in VirtualBox (in Debian_x64) for the last couple of days. Here is my scenario....
I have a dual boot desktop (Win10 & Debian_x64)

CPU: AMD Athlon(tm) II X2 250 (has support for AMD-V)
RAM: 8 GB
MB: MSI 880GMA E35(FX)

I have read the following wiki

https://wiki.gentoo.org/wiki/Binary_package_guide
https://wiki.gentoo.org/wiki/GCC_optimization
https://wiki.gentoo.org/wiki/Portage_TMPDIR_on_tmpfs

I have the following line in my /etc/portage/make.conf
------
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
------

I have been building binaries by including the following with every emerge
--buildpkg --buildpkg-exclude "virtual/* sys-kernel/*-sources"

Now I plan to upgrade my Host-OS to Gentoo by transferring '/user/portage' from the Guest-Machine to the Host-Machine. But I don't know how the binaries will perform, in the other forum a member pointed out that he is building binaries on a Core-2-Duo and installing them on a Core-i5 with no problems. Off the top of my head all I can think is that Core-2Duo CPU capabilities are a subset (reduced version) of the Corei-5 CPU capabilities, (Just like my GUEST "CPU" is a subset of my HOST CPU) so I guess things worked out fine for him (and will for me too).

But what I was wondering is that, will the binaries compiled in Core-2-Duo be able to take advantage all the features in Core-i5? Or, as in my case, will the GUEST binaries be able to take advantages of all the Physical CPU features when installed on the actual machine?

I ask this cause I ran the following commands on both the Host & Guest machines and did a diff; found significant differences, especially in the flags. (diff at the end of post)

1. cat /proc/cpuinfo
2. gcc -c -Q -march=native --help=targetgcc -c -Q -march=native –help=target

I understand that VirtualBox is a “level-2” hypervisor and not all features of the Host CPU will be exposed to the Guest OS and thus some difference should be expected; but will the binaries of the GUEST be able to take full advantage of the physical (HOST) CPU when actually installed on it?

--Case in point---
The 'svm' (AMD vitualization) flag is there in the HOST but not in the GUEST for /proc/cpuinfo (which is normal).
and
'-mcx16' is enabled for HOST but disabled for GUEST (in GCC)
--------------------

Thanks everyone
Emon


diff Guest.txt Host.txt (/proc/cpuinfo....)
Code:

7,8c7,8
< microcode : 0x10000bf
< cpu MHz : 3001.474
---
> microcode : 0x10000c7
> cpu MHz : 800.000
20,22c20,21
< flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx fxsr_opt rdtscp lm 3dnowext 3dnow rep_good nopl extd_apicid pni lahf_lm cmp_legacy cr8_legacy 3dnowprefetch vmmcall
< bugs : tlb_mmatch apic_c1e fxsave_leak sysret_ss_attrs
< bogomips : 6002.94
---
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate npt lbrv svm_lock nrip_save vmmcall
> bogomips : 6000.19
27c26
< power management:
---
> power management: ts ttp tm stc 100mhzsteps hwpstate


diff Guest.txt Host.txt (for gcc)
Code:

 12c12
< -mabm [disabled]
---
> -mabm [enabled]
23c23
< -march= k8-sse3
---
> -march= amdfam10
41c41
< -mcx16 [disabled]
---
> -mcx16 [enabled]
68c68
< -mlzcnt [disabled]
---
> -mlzcnt [enabled]
85c85
< -mpopcnt [disabled]
---
> -mpopcnt [enabled]
89c89
< -mprfchw [disabled]
---
> -mprfchw [enabled]
109c109
< -msse4a [disabled]
---
> -msse4a [enabled]
121c121
< -mtune= k8
---
> -mtune= amdfam10
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum