Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo on KVM: need suggestions for safe CFLAGS
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
borfig
Apprentice
Apprentice


Joined: 27 Oct 2004
Posts: 162

PostPosted: Wed Dec 12, 2007 1:47 pm    Post subject: Gentoo on KVM: need suggestions for safe CFLAGS Reply with quote

I want to install Gentoo on a Kernel-based Virtual Machine, and I could not decide on safe CFLAGS to use.
The /proc/cpuinfo of the guest (x86 - 32bit) is:
Code:
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 2
model name      : QEMU Virtual CPU version 0.9.0
stepping        : 3
cpu MHz         : 2397.598
cache size      : 2048 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 de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm up pni
bogomips        : 5094.61

Any suggestions???
Back to top
View user's profile Send private message
ekz
l33t
l33t


Joined: 21 Jun 2006
Posts: 994
Location: Temuco - Chile

PostPosted: Wed Dec 12, 2007 4:47 pm    Post subject: Reply with quote

Tip:
From http://gentoo-wiki.com/Safe_Cflags
Code:

Note: GCC 4.2 introduces a new -march option, -march=native, which automatically detects the features your CPU supports and sets the options appropriately. If you have an Intel or AMD CPU and are using >=sys-devel/gcc-4.2.0, using -march=native is recommended. Do NOT use -march=native if you use distcc on nodes with different architectures as this may produce unusable code.


Cheers
_________________
Mi tumblelog
Back to top
View user's profile Send private message
borfig
Apprentice
Apprentice


Joined: 27 Oct 2004
Posts: 162

PostPosted: Wed Dec 12, 2007 4:53 pm    Post subject: Reply with quote

how did I missed that green box... :oops:
Back to top
View user's profile Send private message
borfig
Apprentice
Apprentice


Joined: 27 Oct 2004
Posts: 162

PostPosted: Thu Dec 13, 2007 8:22 am    Post subject: Reply with quote

now for the tricky question:
in the kernel configuration - what processor is this???
Back to top
View user's profile Send private message
borfig
Apprentice
Apprentice


Joined: 27 Oct 2004
Posts: 162

PostPosted: Thu Jan 24, 2008 7:37 pm    Post subject: Reply with quote

how about safe CFLAGS for gcc 3.4.x ???
Back to top
View user's profile Send private message
meulie
l33t
l33t


Joined: 17 Jun 2003
Posts: 845
Location: a Dutchman living in Norway

PostPosted: Sun Aug 10, 2008 8:28 am    Post subject: Reply with quote

Or how about correct CFLAGS for a KVM-guest with gcc-4.1.2

cat /proc/cpuinfo gives:
Code:
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 2
model name      : QEMU Virtual CPU version 0.9.1
stepping        : 3
cpu MHz         : 2398.802
cache size      : 2048 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 de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm up pni
bogomips        : 4998.99
clflush size    : 64

_________________
Greetz,
Evert Meulie
Back to top
View user's profile Send private message
o5i
n00b
n00b


Joined: 16 Feb 2013
Posts: 14
Location: Da Haym

PostPosted: Sun May 12, 2013 8:19 pm    Post subject: Reply with quote

Hi i have the same problem, but the thread is old.. Someone know what to do?
Back to top
View user's profile Send private message
Deathwing00
Moderator
Moderator


Joined: 13 Jun 2003
Posts: 4079
Location: Dresden, Germany

PostPosted: Thu May 16, 2013 8:28 pm    Post subject: Reply with quote

Moved from Installing Gentoo to Portage & Programming.
Back to top
View user's profile Send private message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Fri May 17, 2013 3:25 pm    Post subject: Reply with quote

march=native??
Back to top
View user's profile Send private message
o5i
n00b
n00b


Joined: 16 Feb 2013
Posts: 14
Location: Da Haym

PostPosted: Fri May 17, 2013 4:43 pm    Post subject: Reply with quote

No way... I think the compiler didn`t recognize it...
Back to top
View user's profile Send private message
nlsa8z6zoz7lyih3ap
Guru
Guru


Joined: 25 Sep 2007
Posts: 332
Location: Canada

PostPosted: Fri May 17, 2013 5:08 pm    Post subject: Reply with quote

I know that may will consider this to be heresy, but I use (and suggest)
Code:
  -mtune=generic


I used to fuss over the best setting to use in this regard, but after considerable testing I can not find much difference
in performance in my favourite applications between the various choices for -march and -mtune.

The one exception is gcc. It certainly runs faster (for me) with "-mtune=generic" than it does with "-march=native"

Of course on a virtual machine, I think that "-mtune=generic" is the safest choice.


ADDED in Edit:
PS I still use ufed to ensure that particular applications will have USE flags for my cpu's features.

i.e. x264 indicates
Quote:
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX XOP FMA4 SSEMisalign LZCNT


even 'tho I am using "-mtune=generic"
Back to top
View user's profile Send private message
itjunky
n00b
n00b


Joined: 19 Sep 2013
Posts: 1

PostPosted: Thu Sep 19, 2013 12:13 pm    Post subject: Reply with quote

I have a problem with -march=native when i try to emerge anything. I see this error in output:

checking whether the C compiler works... no
configure: error: in `/var/tmp/portage/app-arch/xz-utils-5.0.4-r1/work/xz-5.0.4':
configure: error: C compiler cannot create executables
See `config.log' for more details


When i remove -march=native option, its configured and compiled normaly.

gcc version 4.6.3 (Gentoo 4.6.3 p1.13, pie-0.5.2)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 32305
Location: 56N 3W

PostPosted: Thu Sep 19, 2013 12:24 pm    Post subject: Reply with quote

itjunky,

Please post your
Code:
emerge --info
output
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
nativemad
Developer
Developer


Joined: 30 Aug 2004
Posts: 839
Location: Switzerland

PostPosted: Fri Sep 20, 2013 4:59 am    Post subject: Reply with quote

Just a little tip...
If you're going to run that vm only on that specific hardware, you could start the vm with "-cpu host" as parameter and you'll see the hosts CPU in the VM and -march=native will work! :wink:

Cheers
_________________
Power to the people!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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