Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Cflags & e8400 & gcc-4.3
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
Coin Coin
n00b
n00b


Joined: 28 Oct 2008
Posts: 42

PostPosted: Tue Oct 28, 2008 11:10 am    Post subject: [SOLVED] Cflags & e8400 & gcc-4.3 Reply with quote

Hi,

I have an E8400 (which support sse 4.1) and I have emerge GCC 4.3.2 before emerging all I need for my desktop.
I'm just wondering which cflags I have to set

On the wiki, it mentions:
Code:
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"


and for GCC-4.3, it says to set core2, so now, my cflags are:
Code:
CFLAGS="-march=core2 -O2 -pipe -fomit-frame-pointer"


But, do these cflags activate sse4.1? Or do I have to set mssse3 and msse4.1 like this?
Code:
CFLAGS="-march=core2 -O2 -pipe -fomit-frame-pointer -mssse3 -msse4.1"


PS: Do I need to reemerge all after setting this? (emerge -e world)
PS2: I forgot to mention that I'm installing gentoo with 32bits support and not 64bits (I don't know if it will improve performances for basic uses (C/C++ & openoffice, ...))

(Sorry for my poor english)

Thanks


Last edited by Coin Coin on Tue Oct 28, 2008 1:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
button
n00b
n00b


Joined: 24 Dec 2007
Posts: 65
Location: Croatia

PostPosted: Tue Oct 28, 2008 12:15 pm    Post subject: Reply with quote

You don't need -mssse3; -march=core2 implies it. You do need to set -mssse4.1 since it is not enabled by default.
So, the settings for your CPU would be
Code:
CFLAGS="-march=core2 -O2 -pipe -mssse4.1"

-fomit-frame-pointer is automatically enabled by -O2, so you don't need to specify it explicitly

EDIT: and yes, you need to reemerge all your packages for these settings to take effect
Back to top
View user's profile Send private message
Coin Coin
n00b
n00b


Joined: 28 Oct 2008
Posts: 42

PostPosted: Tue Oct 28, 2008 12:27 pm    Post subject: Reply with quote

Ok, thanks
Last question: If I'm setting gentoo for core 2 duo with just 32 bits support, will sse4.1 be still used? Or do I have to switch to 64 bits?
Back to top
View user's profile Send private message
yngwin
Retired Dev
Retired Dev


Joined: 19 Dec 2002
Posts: 4572
Location: Suzhou, China

PostPosted: Tue Oct 28, 2008 1:09 pm    Post subject: Reply with quote

-msse4.1 will still be used on 32bits (x86 profile) if you set that option. But you should also add -fomit-frame-pointer then, it is only included in -O2 on architectures where it does not interfere with debugging (amd64 for example). As it does interfere on x86, you need to specify it. And make sure you use -O2 (letter O), not -02 (number zero)!
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
Coin Coin
n00b
n00b


Joined: 28 Oct 2008
Posts: 42

PostPosted: Tue Oct 28, 2008 1:17 pm    Post subject: Reply with quote

Ok, thanks! (It's a letter and not a digit, but thanks anyway ^^)
Back to top
View user's profile Send private message
zyko
l33t
l33t


Joined: 01 Jun 2008
Posts: 620
Location: Munich, Germany

PostPosted: Tue Oct 28, 2008 11:36 pm    Post subject: Reply with quote

>=gcc-4.2 has -march=native. This will detect the correct settings for you.

Quote:
PS: Do I need to reemerge all after setting this? (emerge -e world)


Your new settings only affect packages you actually compiled with them. But you don't have to recompile anything, it will work either way. You shouldn't waste time on gcc and glibc. These two filter your CFLAGs internally, so recompiling them for this reason is pointless. Use quickpkg to generate binaries of gcc and glibc and then just run emerge -ek world -- this will recompile everything except for packages that are available as binaries.
Back to top
View user's profile Send private message
neonl
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jul 2007
Posts: 100
Location: Portugal

PostPosted: Wed Oct 29, 2008 10:37 pm    Post subject: Reply with quote

button wrote:
-fomit-frame-pointer is automatically enabled by -O2, so you don't need to specify it explicitly

I don't want to doubt on you (i might be wrong) but i think -fomit-frame-pointer isn't part of O2 on those CPUs. It has to be enable 'separately'. In the GCC 4.3 manual it says:
Quote:
-O2 turns on all optimization flags specified by -O. It also turns on the following optimization flags:

-fthread-jumps
-falign-functions -falign-jumps
-falign-loops -falign-labels
-fcaller-saves
-fcrossjumping
-fcse-follow-jumps -fcse-skip-blocks
-fdelete-null-pointer-checks
-fexpensive-optimizations
-fgcse -fgcse-lm
-foptimize-sibling-calls
-fpeephole2
-fregmove
-freorder-blocks -freorder-functions
-frerun-cse-after-loop
-fsched-interblock -fsched-spec
-fschedule-insns -fschedule-insns2
-fstrict-aliasing -fstrict-overflow
-ftree-pre
-ftree-vrp

And in the -O part, it was specified that -fomit-frame-pointer was only enabled by default in machines where it doesn't interfere with debugging. Correct me if I'm wrong.
Back to top
View user's profile Send private message
button
n00b
n00b


Joined: 24 Dec 2007
Posts: 65
Location: Croatia

PostPosted: Thu Oct 30, 2008 10:03 pm    Post subject: Reply with quote

neonl wrote:
And in the -O part, it was specified that -fomit-frame-pointer was only enabled by default in machines where it doesn't interfere with debugging. Correct me if I'm wrong.


You're right. I wasn't aware of that. However, manpage is a little unclear here, because it doesn't state which architectures are affected. Does somebody have an info about that?
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