
Code: Select all
CFLAGS="-O2 -march=athlon-xp -pipe -mcpu=i686 -fomit-frame-pointer -msse -mmmx -m3dnow -ffast-math -fprefetch-loop-arrays -finline-limit=600 -ftracer
Code: Select all
MPlayer 1.0pre6-3.3.5-20050130 (C) 2000-2004 MPlayer Team
CPU: Advanced Micro Devices Athlon 4 /Athlon MP/XP Palomino (Family: 6, Stepping: 2)
Detected cache-line size is 64 bytes
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE
Warning unknown option cache_min at line 144
Warning unknown option cache_prefill at line 14
Code: Select all
CFLAGS="-march=pentium-m -pipe -mmmx -msse -msse2 -mfpmath=sse \
-fomit-frame-pointer -momit-leaf-frame-pointer -funit-at-a-time -frename-registers \
-O2 -Os -fno-align-functions -fno-align-jumps -fno-align-loops \
-fno-align-labels -fno-reorder-blocks -fno-prefetch-loop-arrays"
ty. I notice that these are on the "safe list" for p4 and not for amd.* -mmmx: Not P4-specific. Supported since Pentium-MMX and AMD K6 (the later revisions).
* -msse: Not P4-specific. Supported since Pentium 3 and AMD Athlon / Duron.
* -m3dnow: Not P4-specific, in fact AMD-specific. Supported since AMD K6-2.

I do not understand why some people think there is a reason to not use flags which are already implied by a previous flag. Ebuilds, particularly poorly written ones, might filter out a general flag like -march but leave something like -mmmx intact.codergeek42 wrote:You don't need to add those though. The proper MMX/SSE/3DNow! options are implied by your "-march=" setting.

Makes sense to me.. Seems like I distinctly remember having to add these for mplayer though. If I didn't use mplayer so often, I'd re-emerge it w/o them so I could see the original messages. But, instead I'll go check to see I overlooked some mplayer use flagsYou don't need to add those though. The proper MMX/SSE/3DNow! options are implied by your "-march=" setting


mplayer's ebuild says:Yup. That's why it has mmx, mmxext, sse, sse2, 3dnow, and 3dnowext USE flags
sometimes I do weird things and spend too much time trying to figure out why. I'm just going to quietly step away from the thread.# let's play the filtration game! MPlayer hates on all!
strip-flags
No, no, no, No, NO. Read this thread and learn one or two things about the concept of optimization before doing that to your system.Gherald wrote:yay, giant thread gone, I can get some personal attention
How's this:Code: Select all
CFLAGS="-march=pentium-m -pipe -mmmx -msse -msse2 -mfpmath=sse \ -fomit-frame-pointer -momit-leaf-frame-pointer -funit-at-a-time -frename-registers \ -O2 -Os -fno-align-functions -fno-align-jumps -fno-align-loops \ -fno-align-labels -fno-reorder-blocks -fno-prefetch-loop-arrays"
Because some people actually know better, out of dire experience...Gherald wrote:I do not understand why some people think there is a reason to not use flags which are already implied by a previous flag.
And might break horribly.Gherald wrote:Ebuilds, particularly poorly written ones, might filter out a general flag like -march but leave something like -mmmx intact.
Which you shouldn't, unless you don't like glibc. There was a bug last year that would kill your glibc if you built it with two -O flags in your CFLAGS. Who's to know if and when that might happen again?Gherald wrote:Notice that I use both -O2 and -Os.
So you object to -mmmx -msse -msse2 and -mfpmath=sse. I've looked into each of them and they seem safe and appropriate.moocha wrote:No, no, no, No, NO. Read this thread and learn one or two things about the concept of optimization before doing that to your system.Gherald wrote:Code: Select all
CFLAGS="-march=pentium-m -pipe -mmmx -msse -msse2 -mfpmath=sse \ -fomit-frame-pointer -momit-leaf-frame-pointer -funit-at-a-time -frename-registers \ -O2 -Os -fno-align-functions -fno-align-jumps -fno-align-loops \ -fno-align-labels -fno-reorder-blocks -fno-prefetch-loop-arrays"
Eh? -mmmx is a perfectly sensible CFLAG that has been around for *very* long time and if an ebuild were to fail because of it, I'd simply uncomment one of the other two settings I keep in make.conf for poor quality ebuilds...And might break horribly.Gherald wrote:Ebuilds, particularly poorly written ones, might filter out a general flag like -march but leave something like -mmmx intact.
Code: Select all
#CFLAGS="-march=i686 -pipe -fomit-frame-pointer"
#CFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer" Hmm, that's a serious bug. Basically I want -Os, but I know there are many ebuilds that do not recognize it is actually _more conservative_ than -O2 and thus filter it out. Hence all the previous -O2 and all the -fno options that follow...Which you shouldn't, unless you don't like glibc.Gherald wrote:Notice that I use both -O2 and -Os.
There was a bug last year that would kill your glibc if you built it with two -O flags in your CFLAGS. Whjo's to know when that will happen again? You're a brave man.
man gcc wrote: -Os Optimize for size. -Os enables all -O2 optimizations that do not
typically increase code size. It also performs further optimiza-
tions designed to reduce code size.
-Os disables the following optimization flags: -falign-functions
-falign-jumps -falign-loops -falign-labels -freorder-blocks
-fprefetch-loop-arrays
If you use multiple -O options, with or without level numbers, the
last such option is the one that is effective.
Strictly speaking, this is not true.Gherald wrote:Basically I want -Os, ... it is actually _more conservative_ than -O2
man gcc wrote:-Os
Optimize for size. -Os enables all -O2 optimizations that do not typically increase code size. It also performs further optimizations designed to reduce code size.
Based on other explanations I've read about what -Os does, I feel confident in saying it is _more conservative_ than -O2 even though it is not strictly a subset of -O2.kimchi_sg wrote:Strictly speaking, this is not true.Gherald wrote:Basically I want -Os, ... it is actually _more conservative_ than -O2man gcc wrote:-Os
Optimize for size. -Os enables all -O2 optimizations that do not typically increase code size. It also performs further optimizations designed to reduce code size.

if an ebuild filters something out, there might be a reason for that... why do you want to break your system?Gherald wrote:I do not understand why some people think there is a reason to not use flags which are already implied by a previous flag. Ebuilds, particularly poorly written ones, might filter out a general flag like -march but leave something like -mmmx intact.codergeek42 wrote:You don't need to add those though. The proper MMX/SSE/3DNow! options are implied by your "-march=" setting.
Notice that I use both -O2 and -Os.
-Os disables some -O2 optimization but also turns on other. Something that compiles with -O2 might break with -Os, perl for example.Gherald wrote:Based on other explanations I've read about what -Os does, I feel confident in saying it is _more conservative_ than -O2 even though it is not strictly a subset of -O2.kimchi_sg wrote:Strictly speaking, this is not true.Gherald wrote:Basically I want -Os, ... it is actually _more conservative_ than -O2man gcc wrote:-Os
Optimize for size. -Os enables all -O2 optimizations that do not typically increase code size. It also performs further optimizations designed to reduce code size.
You don't understand. Let's use a contrived example.superstoned wrote:if an ebuild filters something out, there might be a reason for that... why do you want to break your system?Gherald wrote:I do not understand why some people think there is a reason to not use flags which are already implied by a previous flag. Ebuilds, particularly poorly written ones, might filter out a general flag like -march but leave something like -mmmx intact.codergeek42 wrote:You don't need to add those though. The proper MMX/SSE/3DNow! options are implied by your "-march=" setting.
Notice that I use both -O2 and -Os.

so, you say there are ebuilds that unnecesair filter certain flags. and, altough its very likely they also don't filter certain flags they should if you try to pass around this, you take the risk. well, i hope the dev's don't mind the bugreports...Gherald wrote:You don't understand. Let's use a contrived example.superstoned wrote:if an ebuild filters something out, there might be a reason for that... why do you want to break your system?Gherald wrote:I do not understand why some people think there is a reason to not use flags which are already implied by a previous flag. Ebuilds, particularly poorly written ones, might filter out a general flag like -march but leave something like -mmmx intact.codergeek42 wrote:You don't need to add those though. The proper MMX/SSE/3DNow! options are implied by your "-march=" setting.
Notice that I use both -O2 and -Os.
Suppose "-superflag" enables optimizations -fA, -fB, and -fC and "-lesserflag" only enables optimization -fA.
Thus, compiling a package with "-superflag -lesserflag" enables -fA,-fB,-fC. Compiling a package with only "-superflag" does the same thing.
Now suppose there is an ebuild that needs to disable -fB and -fC, but doesn't care about -fA. The correct way to deal with this would be to append -fnoB and -fnoC to the end of CFLAGS (after -superflag). For simplicity, an ebuild might simply filter out -superflag. But what about -fA? If CFLAGS still contains "-lesserflag", it will be enabled.
Now obviously there would never be a "-lesserflag" that only enables one thing (-fA) but this isn't meant to be a real example.
... to understand exactly why the ebuild does this, before even considering dangerous things like flag redundancy.Gherald wrote:You don't understand. Let's use a contrived example.superstoned wrote:if an ebuild filters something out, there might be a reason for that... why do you want to break your system?
Suppose "-superflag" enables optimizations -fA, -fB, and -fC and "-lesserflag" only enables optimization -fA.
Thus, compiling a package with "-superflag -lesserflag" enables -fA,-fB,-fC. Compiling a package with only "-superflag" does the same thing.
Now suppose there is an ebuild that needs to disable -fB and -fC, but doesn't care about -fA. The correct way to deal with this would be...
Um, sounds like you've sorta got the idea. But the important thing to realize is that only wrong or poorly written ebuilds will be affected...superstoned wrote:so, you say there are ebuilds that unnecesair filter certain flags. and, altough its very likely they also don't filter certain flags they should if you try to pass around this, you take the risk.
...so they certainly should not mind.well, i hope the dev's don't mind the bugreports...

altough you might be right, i think this way you put an undesirable and unnecesairy burden on the developers. if they choose, for time constraints, to block flags "the easy way", they should be free to do so. don't force them to spend more time on it (unless you want to do it yourself) as they are willing to. they are volunteers! also, any speedgain would be extremely small - so i think they acutally should block flags the easy way, if they want to - let them spend time on more important things, be it gentoorelated or not.Gherald wrote:Um, sounds like you've sorta got the idea. But the important thing to realize is that only wrong or poorly written ebuilds will be affected...superstoned wrote:so, you say there are ebuilds that unnecesair filter certain flags. and, altough its very likely they also don't filter certain flags they should if you try to pass around this, you take the risk....so they certainly should not mind.well, i hope the dev's don't mind the bugreports...