Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Extreme CFLAGS problems...
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
Enlight
Advocate
Advocate


Joined: 28 Oct 2004
Posts: 3519
Location: Alsace (France)

PostPosted: Mon Apr 04, 2005 1:52 pm    Post subject: Reply with quote

On my amd box, I never saw faster than -march=athlon-xp -O2 -fomit-frame-pointers (gcc 3.3.5 and 3.4.3) most of other stuffs gave me an extra slow-down when they didn't bork stuffs (only taking usr & sys in account.).

I'm currently using taviso's LDFLAGS but they borked emacs, so when it comes to emerge it, I remove 'em.
Back to top
View user's profile Send private message
Bob P
Advocate
Advocate


Joined: 20 Oct 2004
Posts: 3355
Location: Jackass! Development Labs

PostPosted: Mon Apr 04, 2005 10:59 pm    Post subject: Reply with quote

yogi85 wrote:
So, kimchi...or anybody...please answer my question coz i'm kind of blur of this cflags rite now....

when in doubt, keep your cflags simple.
_________________
.
Stage 1/3 | Jackass! | Rockhopper! | Thanks | Google Sucks
Back to top
View user's profile Send private message
whitesouls
Guru
Guru


Joined: 19 Nov 2004
Posts: 358
Location: In Front of My Laptop

PostPosted: Tue Apr 05, 2005 3:35 pm    Post subject: Reply with quote

yeah..wat our saying is true oso...but i wanna learn and some other ppl will learn by reading our posts...tht's all...:D
_________________
whitesouls

Please insert the [SOLVED] tag if your problem is solved in your respective thread.
Back to top
View user's profile Send private message
FastTurtle
Guru
Guru


Joined: 03 Sep 2002
Posts: 477
Location: Flakey Shake & Bake Caliornia, USA

PostPosted: Tue Jun 14, 2005 8:00 pm    Post subject: Reply with quote

Here's my thinking on the whole issue of cflags:

1) Remove parsing of cflags/ldflags from make.conf but do keep cpu tuning something like this:
Quote:

Choose your specific CPU if you want to maximize tuning. Otherwise stick with the Same Setting as your chost listing.

Recognized CPU's include Pentium, K6, K6-2(3), P3, P4, Athlon, Athlon-tbird, Athlon-Xp, Athlon64
and leave it at that.

2) Stick with stable Cflags in the ebuilds. Go for stability and if someone needs maximum performance they can still edit the ebuild themselves and realize they wont get alot of support from the devs.

3) Consolidate package.keywords package.use into make.conf for better optimiztions and strip from make.defaults any flag not required by the base build. This means No X unless it disables the feature such as -X -gnome.

I think this will retain the freedom of choice we all desire while reducing bug reports from insane cflags and ldflag options.

Final Option
Quit filtering cflags and allow darwin to take action. Anyone who's foolish enough to play with a loaded gun should just remove themselves from the gene pool and be done with it, thus saving us the time&effort of idiot proofing things for them while improving the Inteligence of the Species. Thank you for your consideratation and immediate implementation.
_________________
AsRock B550 Phantom Gaming 4
128GB 3200 Mhz memory
4x 4TB Sata - 2x 2TB Sata SSD - 4x 450GB SaS - 3x 900GB SaS - 72GB SaS for Boot
LSI 9211-8i in HBA mode for all of the SaS drives
Radeon 6800 (Non XT) for GPU
Back to top
View user's profile Send private message
IvanYosifov
l33t
l33t


Joined: 15 Oct 2004
Posts: 778
Location: Bulgaria

PostPosted: Wed Jun 15, 2005 2:01 pm    Post subject: Reply with quote

Quote:

Quit filtering cflags and allow darwin to take action. Anyone who's foolish enough to play with a loaded gun should just remove themselves from the gene pool and be done with it, thus saving us the time&effort of idiot proofing things for them while improving the Inteligence of the Species. Thank you for your consideratation and immediate implementation.

Countrary to what you obviously believe, many CFLAGS problems are caused by lack of knowledge, not desire to push limits at all costs. Put simply: some people don't know that the thing they play with is a gun, and that it is loaded.

You seem to be interested in improving the situation. If so, once you see insane CFLAGS, post a 3-line reasonable explanation what exactly can go wrong. This will help a hell of a lot more than a 3-line "DIE FOOLISH IDIOT DIE" message !

Like it or not, the world in general and the Gentoo userbase in concrete is not composed of all-knowing semi-gods, and Gentoo is not an only-for-the-elite distro.

Darwin works all the time. If your suggestion is implemented ( filtering stopped ), Gentoo will die rather quickly. It simply wont work for too many people. Besides, there is not a single CFLAG that will work on all ebuilds.

Anger and frustration are bad, counter-productive. Go for a walk. Play some sport. Get some energy out :wink:

This is my thinking on the whole issue of CFLAGS.
Back to top
View user's profile Send private message
Gotterdammerung
l33t
l33t


Joined: 11 Feb 2004
Posts: 627
Location: Rio de Janeiro, Brazil

PostPosted: Tue Nov 29, 2005 2:29 am    Post subject: Reply with quote

What about these CFLAGS:

Code:
CFLAGS="-O2 \
        -mtune=athlon-xp \
        -pipe \
        -fomit-frame-pointer \
        -ftracer \
        -momit-leaf-frame-pointer \
        -fno-ident \
        -finline-functions \
        -fforce-addr \
        -fprefetch-loop-arrays  \
        -falign-functions=64 \
        -ffast-math"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"

_________________
A mind that is stretched by a new experience can never go back to its old dimensions. - Oliver Wendell Holmes
Back to top
View user's profile Send private message
96140
Retired Dev
Retired Dev


Joined: 23 Jan 2005
Posts: 1324

PostPosted: Tue Nov 29, 2005 6:24 am    Post subject: Reply with quote

Tleilaxu wrote:
What about these CFLAGS:

Code:
CFLAGS="-O2 \
        -mtune=athlon-xp \
        -pipe \
        -fomit-frame-pointer \
        -ftracer \
        -momit-leaf-frame-pointer \
        -fno-ident \
        -finline-functions \
        -fforce-addr \
        -fprefetch-loop-arrays  \
        -falign-functions=64 \
        -ffast-math"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"

-fprefetch-loop-arrays is bad for your health. and remove -falign-functions=64 immediately. And take out -ffast-math; that's a pretty well-known dangerous "optimization". -fno-ident is useless. And it's counterproductive to enable both -fomit-frame-pointer and -momit-leaf-frame-pointer. There's a thread floating around that compares the two and examines their effects when used. Pick one or the other, not both.

Change -mtune= to -march=; that's the best way to generate processor-specific code.
Back to top
View user's profile Send private message
IvanYosifov
l33t
l33t


Joined: 15 Oct 2004
Posts: 778
Location: Bulgaria

PostPosted: Tue Nov 29, 2005 9:26 am    Post subject: Reply with quote

nightmorph wrote:
And it's counterproductive to enable both -fomit-frame-pointer and -momit-leaf-frame-pointer. There's a thread floating around that compares the two and examines their effects when used. Pick one or the other, not both.

Uh ? -fomit-frame-pointer implies -momit-leaf-frame-pointer. Using both is exactly the same as using only -fomit-frame-pointer, except when an ebuild filters one but not the other, however I don't know if such ebuilds exist and if they break. What thread are you refering to ?

nightmorph wrote:

Change -mtune= to -march=; that's the best way to generate processor-specific code.

I would suggest adding both -march and -mtune. ( I know the sense of this is debatable, just my 2c ).
Back to top
View user's profile Send private message
Enlight
Advocate
Advocate


Joined: 28 Oct 2004
Posts: 3519
Location: Alsace (France)

PostPosted: Tue Nov 29, 2005 12:59 pm    Post subject: Reply with quote

IvanYosifov wrote:
...


I guess he meant that as is trying to something that has already been done by gcc, so compile time waste only, cause IIRC -fomit-frame-pointer is member of ALLOWED_FLAGS.
Back to top
View user's profile Send private message
6D7474
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2005
Posts: 135

PostPosted: Tue Nov 29, 2005 5:24 pm    Post subject: Reply with quote

IvanYosifov wrote:
nightmorph wrote:
And it's counterproductive to enable both -fomit-frame-pointer and -momit-leaf-frame-pointer. There's a thread floating around that compares the two and examines their effects when used. Pick one or the other, not both.

Uh ? -fomit-frame-pointer implies -momit-leaf-frame-pointer. Using both is exactly the same as using only -fomit-frame-pointer, except when an ebuild filters one but not the other, however I don't know if such ebuilds exist and if they break. What thread are you refering to ?

nightmorph wrote:

Change -mtune= to -march=; that's the best way to generate processor-specific code.

I would suggest adding both -march and -mtune. ( I know the sense of this is debatable, just my 2c ).


-momit-leaf-frame-pointer overrides -fomit-frame-pointer...
take a look at https://forums.gentoo.org/viewtopic-t-333123-postdays-0-postorder-asc-highlight-cflags+central-start-75.html
Back to top
View user's profile Send private message
96140
Retired Dev
Retired Dev


Joined: 23 Jan 2005
Posts: 1324

PostPosted: Tue Nov 29, 2005 5:25 pm    Post subject: Reply with quote

6D7474 wrote:
-momit-leaf-frame-pointer overrides -fomit-frame-pointer...
take a look at https://forums.gentoo.org/viewtopic-t-333123-postdays-0-postorder-asc-highlight-cflags+central-start-75.html

Thanks. This is the thread I was referring to. There's a couple of others, as well, but I haven't been able to find them again.
Back to top
View user's profile Send private message
pv
Tux's lil' helper
Tux's lil' helper


Joined: 25 Mar 2005
Posts: 103
Location: Russia, Yaroslavl

PostPosted: Thu Dec 01, 2005 1:00 pm    Post subject: Reply with quote

I have a box with Athlon XP 2500+ (1833) (Barton). Now I use GCC 3.3.5-20050120 (x86) but I'm going to upgrade my system to use GCC-3.4.4 (~x86).
My CFLAGS are
Code:
CFLAGS="-march=athlon-xp -O3 -momit-leaf-frame-pointer -fomit-frame-pointer \
-fno-align-jumps -fno-align-labels -fno-align-loops -fno-align-functions \
-mmmx -m3dnow -msse -ffast-math -mfpmath=sse -s -pipe"
LDFLAGS="-s"
CXXFLAGS="$CXXFLAGS"


I'd like to describe them first.
Code:
-march=athlon-xp -O3 -fomit-frame-pointer -pipe
are recommended everywhere.
Code:
-momit-leaf-frame-pointer
maybe helps me if emerge remove -fomit-frame-pointer and forget about the given flag. Am I right?
Code:
-fno-align-jumps -fno-align-labels -fno-align-loops -fno-align-functions
are here because GCC aligns loops and labels by inserting a special processor instruction (nop) which do nothing but requires one processor cycle to execute it and a byte to store it in a program (to align). Moreover, aligning doesn't take place everytime it's needed but just if it can be made by inserting no more than 7 nop's. The default align is on 16-byte boundary so about a HALF OF ALL loops wouldn't be aligned at all! So, with these options I decrease a program size and (possibly) consequently the loading time.
Code:
-mmmx -m3dnow -msse
allow programs to use machine-specific instruction sets mentioned. If a program doesn't know about ones it doesn't use them. Why not to add them?
Code:
-s (CFLAGS and LDFLAGS)
removes debug (and what?) symbols from programs compiled. I know Gentoo strips result binaries with the 'strip' command but using the option I reach better results (this has been checked).
Can somebody advise me something else (-mpreferred-stack-boundary=8, for example) or just comment the thoughts above or the CFLAGS shown?
Should I do an upgrade to GCC-3.4.4? What GCC is faster and what gcc generates smaller binaries?
_________________
Nothing but perfection.
Back to top
View user's profile Send private message
Enlight
Advocate
Advocate


Joined: 28 Oct 2004
Posts: 3519
Location: Alsace (France)

PostPosted: Thu Dec 01, 2005 1:55 pm    Post subject: Reply with quote

nightmorph wrote:
6D7474 wrote:
-momit-leaf-frame-pointer overrides -fomit-frame-pointer...
take a look at https://forums.gentoo.org/viewtopic-t-333123-postdays-0-postorder-asc-highlight-cflags+central-start-75.html

Thanks. This is the thread I was referring to. There's a couple of others, as well, but I haven't been able to find them again.


Uh? 8O that's so weird to have -momit disablin -fomit , it should be the contrary 8O 8O 8O I'm glad I only used -fomit-frame-pointer
Back to top
View user's profile Send private message
Gergan Penkov
Veteran
Veteran


Joined: 17 Jul 2004
Posts: 1464
Location: das kleinste Kuhdorf Deutschlands :)

PostPosted: Thu Dec 01, 2005 2:37 pm    Post subject: Reply with quote

Well just my 2c, if someone depends on a broken app like acovea to set his/her cflags, it is his/her right to do so.
I've learned my lesson - even the fomit-frame-pointer could lead to visible slowdowns on athlonxp.
now i use only
Quote:
CFLAGS="-march=athlon-xp -O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"

and i could bet that my system is faster and far more stable than most of what you have there with these cflags.
what about for example openoffice-2 draw starting in 5 seconds :) on athlonXP-2000+ ?
_________________
"I knew when an angel whispered into my ear,
You gotta get him away, yeah
Hey little bitch!
Be glad you finally walked away or you may have not lived another day."
Godsmack
Back to top
View user's profile Send private message
Enlight
Advocate
Advocate


Joined: 28 Oct 2004
Posts: 3519
Location: Alsace (France)

PostPosted: Thu Dec 01, 2005 2:58 pm    Post subject: Reply with quote

Gergan Penkov wrote:
Well just my 2c, if someone depends on a broken app like acovea to set his/her cflags, it is his/her right to do so.
I've learned my lesson - even the fomit-frame-pointer could lead to visible slowdowns on athlonxp.
now i use only
Quote:
CFLAGS="-march=athlon-xp -O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"

and i could bet that my system is faster and far more stable than most of what you have there with these cflags.
what about for example openoffice-2 draw starting in 5 seconds :) on athlonXP-2000+ ?


How could making %ebp available for other things and replacing move %esp %ebp (and the opposite) by add or sub absolute values to %esp lead to slowdown?

And concerning LDFLAGS, I don't have many clues but I used to thing that --as-needed was breaking stuffs and should be used with great caution. Plus I don't thing "my" --sort-common an -fomit-frame-pointer (wich are the only extras I've got compared to you, could get me into particular troubles.
Back to top
View user's profile Send private message
Gergan Penkov
Veteran
Veteran


Joined: 17 Jul 2004
Posts: 1464
Location: das kleinste Kuhdorf Deutschlands :)

PostPosted: Thu Dec 01, 2005 3:10 pm    Post subject: Reply with quote

This is my personal observation and probably depends on a compiler version, but I have had visible slowdowns on athlonxp, it could be that the implementation displaces the registers in some way. I have read only positive comments for pentium4, but on athlonxp ...
Yes, I know that --as-needed breaks things, but it is the way to go if you want speedup for the startup times, it is simply so that these flags or more of them will help on computational intensive tasks, so it is probably a good idea to have them in ffmpeg or mplayer but not on all the things you compile:)
and as-needed will reduce memory usage, which in term will bring faster desktop, there is a thread about it and it will break some 20 apps the others are just ok.
_________________
"I knew when an angel whispered into my ear,
You gotta get him away, yeah
Hey little bitch!
Be glad you finally walked away or you may have not lived another day."
Godsmack
Back to top
View user's profile Send private message
Enlight
Advocate
Advocate


Joined: 28 Oct 2004
Posts: 3519
Location: Alsace (France)

PostPosted: Thu Dec 01, 2005 4:15 pm    Post subject: Reply with quote

Do you have any bench about the fomit-frame-pointer? I've got an athlon-xp and on the few apps I tested it, I saw major speed-up. I woul also be interested in seeing the list of the apps broken by --as-needed, a link or something?
Back to top
View user's profile Send private message
Gergan Penkov
Veteran
Veteran


Joined: 17 Jul 2004
Posts: 1464
Location: das kleinste Kuhdorf Deutschlands :)

PostPosted: Thu Dec 01, 2005 5:48 pm    Post subject: Reply with quote

Now you could read little about how this began for me https://forums.gentoo.org/viewtopic-t-386827-highlight-.html, but there are no answers to this thread for now. The as-needed thread could be found here (with most of the broken packages and hints for per app {c|ld}flags) https://forums.gentoo.org/viewtopic-t-316445-highlight-.html
on the fomit-frame pointer - this was probably a year ago (in the time, when this acovea madness was really popular), so probably it was because the compiler, but I've had recompiled my whole system with it and it was sluggish - so I don't have any benchmarks or so and I don't have the time to test it one more time ::)) and I also don't have the reason to do it:)
_________________
"I knew when an angel whispered into my ear,
You gotta get him away, yeah
Hey little bitch!
Be glad you finally walked away or you may have not lived another day."
Godsmack
Back to top
View user's profile Send private message
codergeek42
Bodhisattva
Bodhisattva


Joined: 05 Apr 2004
Posts: 5142
Location: Anaheim, CA (USA)

PostPosted: Thu Dec 01, 2005 6:27 pm    Post subject: Reply with quote

pv wrote:
Code:
-march=athlon-xp -O3 -fomit-frame-pointer -pipe
are recommended everywhere.
"-O3" will break things. You really should be using "-O2" instead.
Quote:
Code:
-mmmx -m3dnow -msse
allow programs to use machine-specific instruction sets mentioned. If a program doesn't know about ones it doesn't use them. Why not to add them?
These are implied by "-march=athlon-xp," so you probably do not need them.
Quote:
Code:
-s (CFLAGS and LDFLAGS)
removes debug (and what?) symbols from programs compiled. I know Gentoo strips result binaries with the 'strip' command but using the option I reach better results (this has been checked).
Erm. You really don't want to strip everything. Lots of shared libraries (essentially almost everything in /lib and /usr/lib, think glibc, OpenSSL, etc.) won't work with nonexistant symbol tables! :!:
_________________
~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF
Back to top
View user's profile Send private message
pv
Tux's lil' helper
Tux's lil' helper


Joined: 25 Mar 2005
Posts: 103
Location: Russia, Yaroslavl

PostPosted: Thu Dec 01, 2005 8:36 pm    Post subject: Reply with quote

Quote:
Lots of shared libraries (essentially almost everything in /lib and /usr/lib, think glibc, OpenSSL, etc.) won't work with nonexistant symbol tables!


Are you sure? I'm sitting at my box and writing this post and everithing seems ok. I haven't notice any problems for the last 3 or 4 months (4 months ago I started using Gentoo). Maybe ebuilds that won't work with these flags strip them.
_________________
Nothing but perfection.
Back to top
View user's profile Send private message
codergeek42
Bodhisattva
Bodhisattva


Joined: 05 Apr 2004
Posts: 5142
Location: Anaheim, CA (USA)

PostPosted: Thu Dec 01, 2005 9:51 pm    Post subject: Reply with quote

pv wrote:
Quote:
Lots of shared libraries (essentially almost everything in /lib and /usr/lib, think glibc, OpenSSL, etc.) won't work with nonexistant symbol tables!


Are you sure? I'm sitting at my box and writing this post and everithing seems ok. I haven't notice any problems for the last 3 or 4 months (4 months ago I started using Gentoo). Maybe ebuilds that won't work with these flags strip them.
Good point then. I concede. :)
_________________
~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Page 10 of 10

 
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