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  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Wed Mar 16, 2005 9:08 pm    Post subject: Reply with quote

racoontje wrote:
Wouldn't it be much easier to simply ignore bug reports that were sent in with -ffast-math, -omg-optimized etc? If you hide CFLAGS better, ricers will look harder, plus they will think they are even 'better' because they had to 'work so hard' to get their system 'optimized'.

We do. We are then treated to either faked emerge info output or, more commonly, a lengthy rant about how -fuck-up-my-system doesn't produce broken code and how it can't possibly be caused by their CFLAGS.
Back to top
View user's profile Send private message
racoontje
Veteran
Veteran


Joined: 19 Jul 2004
Posts: 1290

PostPosted: Wed Mar 16, 2005 9:10 pm    Post subject: Reply with quote

Wow. You put up with a lot more shit than I would.


First, the easy bit. The ranters. Ignore. There opinion is worthless. They will die soon.

Well, the last part isn't true. It should be. Anyone up for a private militia :P


Faked emerge --info output, well, that's just icky.
Back to top
View user's profile Send private message
stonent
Veteran
Veteran


Joined: 07 Aug 2003
Posts: 1139
Location: Texas

PostPosted: Wed Mar 16, 2005 10:52 pm    Post subject: Reply with quote

Ya know, the devs won't want to hear it, but... I think all this home tuning/hacking the CFLAGS, LDFLAGS etc strengthens the whole Linux and GNU system. (Not system as in a PC but system as in organization)

Gentoo probably turns up more bugs than any other distro by sheer brute force.

GCC-4 for example now errors out on certain things that were technically not valid (Not ANSI C) but allowed before. I see the GCC-4 thread providing a lot of good info, patches and such.

Other distrubutions benefit from Gentoo's relentless attacks on the code that they use. I do agree too many CFLAGS can be a bad thing. Mine are pretty tame considering I'm running with a lot of things -* and GCC-4.

"-march=pentium3 -O2 -fweb -pipe -fomit-frame-pointer -ftracer -fforce-addr -ftree-vectorize -ftree-vectorizer-verbose=1 "
_________________
Inspiron 4100 & Sun UltraAXe
Portage on Solaris|Dell Laptop Hacks
The way you feel about organized religion is the same way I feel about organized socialism.
Back to top
View user's profile Send private message
TheCoop
Veteran
Veteran


Joined: 15 Jun 2002
Posts: 1814
Location: Where you least expect it

PostPosted: Wed Mar 16, 2005 10:54 pm    Post subject: Reply with quote

Gentoo does help stop programmers from being lazy, so they write completely airtight code. That can only be a good thing, whichever way you look at it
_________________
95% of all computer errors occur between chair and keyboard (TM)

"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler

Change the world - move a rock
Back to top
View user's profile Send private message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Wed Mar 16, 2005 10:58 pm    Post subject: Reply with quote

stonent wrote:
Ya know, the devs won't want to hear it, but... I think all this home tuning/hacking the CFLAGS, LDFLAGS etc strengthens the whole Linux and GNU system. (Not system as in a PC but system as in organization)

We'd get a heck of a lot more done if we weren't wasting time tracking down bogus bugs caused by dodgy not intended for general use compiler settings.

TheCoop wrote:
Gentoo does help stop programmers from being lazy, so they write completely airtight code. That can only be a good thing, whichever way you look at it

Eh?
Back to top
View user's profile Send private message
stonent
Veteran
Veteran


Joined: 07 Aug 2003
Posts: 1139
Location: Texas

PostPosted: Thu Mar 17, 2005 3:59 am    Post subject: Reply with quote

Well, I know it may be some suprise but if I do report a bug. I always try to

CFLAGS="" LDFLAGS="" emerge blah
_________________
Inspiron 4100 & Sun UltraAXe
Portage on Solaris|Dell Laptop Hacks
The way you feel about organized religion is the same way I feel about organized socialism.
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2968

PostPosted: Thu Mar 17, 2005 6:56 am    Post subject: Reply with quote

stonent wrote:
Well, I know it may be some suprise but if I do report a bug. I always try to

CFLAGS="" LDFLAGS="" emerge blah

That may not help if the toolchain has been b0rked by virtue of it being compiled with over-zealous CFLAGS. In that case, there's no guarantee that sane CFLAGS will cause these faulty tools to produce good binaries. :roll:

That's possible, even though the flag filtering in the glibc is almost airtight and the same goes for gcc. I don't know about binutils though.
Back to top
View user's profile Send private message
Birtz
Apprentice
Apprentice


Joined: 09 Feb 2005
Posts: 272
Location: Osijek / Croatia

PostPosted: Thu Mar 17, 2005 7:03 am    Post subject: Reply with quote

@ciaranm:

You can't treat the whole community as a "bunch of users". There are people here which are developers like you are, alas not Gentoo developers. When I read your replies I feel a bit patronized, and, to be honest I very much dislike that. You have made your point, C(XX)FLAGS, LDFLAGS and friends, are the heart of Gentoo build system, if you break "the rules" using nodocumented/bugged/alpha features of the GCC you are on your own. And that point is obviuous to 98% of intelligent "bunch of users" you are reffering to. Just ignore the rest.

Cheers
_________________
It is not enough to have a good mind. The main thing is to use it well.
-- Rene Descartes

Don't have a childhood hero? How about Rob Hubbard http://www.freenetpages.co.uk/hp/tcworh/profile.htm
Back to top
View user's profile Send private message
Athas
Guru
Guru


Joined: 04 Sep 2003
Posts: 394
Location: Brøndby, Denmark

PostPosted: Thu Mar 17, 2005 7:07 am    Post subject: Reply with quote

TheCoop wrote:
Gentoo does help stop programmers from being lazy, so they write completely airtight code. That can only be a good thing, whichever way you look at it


Um, compiler optimizations can easily break correct and well-defined code. It's more or less russian roulette, as to whether the optimizer mangles the code due to some insane flag, or whether just that portion of code can make it through safely. No-one's claiming that all code breaks with -ffast-math, but a lot of valid code does. Or maybe it doesn't just break, but actually produces incorrect results at runtime.
_________________
Emacs-optimized danish console keymap - My .emacs
Climacs - next generation Emacs.
Back to top
View user's profile Send private message
racoontje
Veteran
Veteran


Joined: 19 Jul 2004
Posts: 1290

PostPosted: Thu Mar 17, 2005 11:52 am    Post subject: Reply with quote

True. Perfect ANSI C has been known to break because -ffast-math thinks it should be something else.
Back to top
View user's profile Send private message
TheCoop
Veteran
Veteran


Joined: 15 Jun 2002
Posts: 1814
Location: Where you least expect it

PostPosted: Thu Mar 17, 2005 1:49 pm    Post subject: Reply with quote

well, apart from -ffast-math and other documented bad flags
_________________
95% of all computer errors occur between chair and keyboard (TM)

"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler

Change the world - move a rock
Back to top
View user's profile Send private message
racoontje
Veteran
Veteran


Joined: 19 Jul 2004
Posts: 1290

PostPosted: Thu Mar 17, 2005 1:58 pm    Post subject: Reply with quote

Athas wrote:
TheCoop wrote:
Gentoo does help stop programmers from being lazy, so they write completely airtight code. That can only be a good thing, whichever way you look at it


Um, compiler optimizations can easily break correct and well-defined code. It's more or less russian roulette, as to whether the optimizer mangles the code due to some insane flag, or whether just that portion of code can make it through safely. No-one's claiming that all code breaks with -ffast-math, but a lot of valid code does. Or maybe it doesn't just break, but actually produces incorrect results at runtime.


-ffdiv-simulator
Back to top
View user's profile Send private message
Xaignar
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 153
Location: Denmark

PostPosted: Thu Mar 17, 2005 5:11 pm    Post subject: Reply with quote

TheCoop wrote:
well, apart from -ffast-math and other documented bad flags

Yes of course. Because, as we all know, the GCC source-code is the shining example of code perfection that we should all strive for. In fact, the only bugs in the code-base are intentionally inserted, in order to give the GCC developers something to do and any broken flags are kept only for reasons of nostalgia. Never has there been wrong assembler generation on valid code and never has there been bugs in corner-cases introduced by rarely used optimizations. Nor has there ever been any problems in the rest of the toolchain, except in a single case where a user's computer was struck by a meteorite while linking a binary! Any word to the contrary is merely the heretical utterings of the fiends at Redmond and should be derided as the anti OSS propaganda it is! Thanks to the GCC development team, the term "Human Error" is but a bad memory of the past!

It is of course a shame that 3rd party developers are unable to follow in the footsteps of the mighty GCC developers and their rampant disregard for the ideals set forth by the GCC development team has been the cause of all bugs (with the exception of the meteorite induced bug described above)! Therefore, you can safely point your fingers at the wretched developers of the application that failed to compile or run, safe in the knowledge that the tool-chain at least is safe from any problems whatsoever!
Back to top
View user's profile Send private message
TheCoop
Veteran
Veteran


Joined: 15 Jun 2002
Posts: 1814
Location: Where you least expect it

PostPosted: Thu Mar 17, 2005 7:10 pm    Post subject: Reply with quote

eeerrrrmmmm, i didnt say that. However, airtight code should be able to handle reasonable flags being thrown at it, rather than breaking as soon as you add in -fsmall-optimization.
_________________
95% of all computer errors occur between chair and keyboard (TM)

"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler

Change the world - move a rock
Back to top
View user's profile Send private message
Athas
Guru
Guru


Joined: 04 Sep 2003
Posts: 394
Location: Brøndby, Denmark

PostPosted: Thu Mar 17, 2005 7:34 pm    Post subject: Reply with quote

TheCoop wrote:
eeerrrrmmmm, i didnt say that. However, airtight code should be able to handle reasonable flags being thrown at it, rather than breaking as soon as you add in -fsmall-optimization.


As far as I recall, the Linux kernel itself is extremely sensitive to compiler flags. Does that mean the code is bad? No. Some compiler-flags are suitable for some applications, and not for others. It depends on which kind of work the application does.
_________________
Emacs-optimized danish console keymap - My .emacs
Climacs - next generation Emacs.
Back to top
View user's profile Send private message
Xaignar
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 153
Location: Denmark

PostPosted: Thu Mar 17, 2005 7:49 pm    Post subject: Reply with quote

Also, you've forgotten something very important: There is no such thing as airtight code. At best, there is code that handles all conditions that you are aware of (all conditions that can be handled), however, to handle all conditions would be near impossible as many are outside of the scope of control that developers have. Compiler bugs are one such issue, though I'd agree that it is sometimes possible for the developer to work around the specific issue. It is however not very feasible to spend time on doing that, unless the bug appears often or occurs due to required code for a required platform/compiler-suite.

Anyway, sorry about the post above, it came out much less light-hearted than I had intended. ;)
Back to top
View user's profile Send private message
racoontje
Veteran
Veteran


Joined: 19 Jul 2004
Posts: 1290

PostPosted: Thu Mar 17, 2005 9:44 pm    Post subject: Reply with quote

You do have a combination of proper programming habits in combination with proper ANSI C. Comes close enough.
Back to top
View user's profile Send private message
Xaignar
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 153
Location: Denmark

PostPosted: Thu Mar 17, 2005 9:52 pm    Post subject: Reply with quote

racoontje wrote:
You do have a combination of proper programming habits in combination with proper ANSI C. Comes close enough.

Yes, of course, cause we all program in C and C is known to be invulnerable to compiler bugs, broken libraries and so on and so forth ... oh, wait a minute. That's so far away that'd I'd have to get personal with NASA!
Back to top
View user's profile Send private message
racoontje
Veteran
Veteran


Joined: 19 Jul 2004
Posts: 1290

PostPosted: Thu Mar 17, 2005 9:58 pm    Post subject: Reply with quote

Wow, you're pulling sarcasm so far that your sentences stop making sense.

You can't deny that -ffast-math et allii produce broken binaries in a lot of programs (developers will confirm this). Turning -ffast-math (and others, you get the picture) off causes this code to work flawlessly.
Back to top
View user's profile Send private message
Xaignar
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 153
Location: Denmark

PostPosted: Thu Mar 17, 2005 10:11 pm    Post subject: Reply with quote

I'm not sure you noticed it, but the conclusion of this thread so far has been that people do in fact make use of said broken flags, thus, we get broken stuff regardless of people programming in C and having "proper programming habits". And where exactly did I ever deny that some flags produce broken code? I did however deny the feasibility your ridiculous solution to said problem and outlined futher issues that your "solution" would not do anything to solve, thus being anything but "close enough".

Also, your sarcasm-fu is weak!
Back to top
View user's profile Send private message
discomfitor
l33t
l33t


Joined: 21 Feb 2003
Posts: 927
Location: None

PostPosted: Thu Mar 17, 2005 10:11 pm    Post subject: Reply with quote

Some "optimizing" flags not only result in broken binaries, but they actually SLOW DOWN execution.

See this thread for all the rice-related information that you need.
_________________
There is no substitute for experience.
Imperfection indicates a lack of effort.
Back to top
View user's profile Send private message
racoontje
Veteran
Veteran


Joined: 19 Jul 2004
Posts: 1290

PostPosted: Fri Mar 18, 2005 7:03 am    Post subject: Reply with quote

Xaignar wrote:
I'm not sure you noticed it, but the conclusion of this thread so far has been that people do in fact make use of said broken flags, thus, we get broken stuff regardless of people programming in C and having "proper programming habits".
Hold on there, Skippy. There is plenty of code that works properly. There is also plenty of proper code that breaks anyway due to optimilizations.
Quote:
And where exactly did I ever deny that some flags produce broken code? I did however deny the feasibility your ridiculous solution to said problem and outlined futher issues that your "solution" would not do anything to solve, thus being anything but "close enough".
Notice that you've been ranting for five posts, yet you claim to be only talking about the one in my previous post. Where did the others go?
Quote:


Also, your sarcasm-fu is weak!

You're 14, right? Don't answer that. We all know the answer and we all know you'll lie.

Plus, there IS plenty of code that wouldn't break under certain circumstances if implemented otherwise. If you don't want to call 'otherwise' 'properly', be my guest.
Back to top
View user's profile Send private message
Xaignar
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 153
Location: Denmark

PostPosted: Fri Mar 18, 2005 11:48 am    Post subject: Reply with quote

racoontje wrote:
Xaignar wrote:
I'm not sure you noticed it, but the conclusion of this thread so far has been that people do in fact make use of said broken flags, thus, we get broken stuff regardless of people programming in C and having "proper programming habits".


Hold on there, Skippy. There is plenty of code that works properly. There is also plenty of proper code that breaks anyway due to optimilizations.

Yes. That is the problem. You can't just say that code that breaks due to optimizations is "bad", though of course I'll agree that code that violates the standards is probably much more likely to produce different results during optimization passes.

racoontje wrote:
Quote:
And where exactly did I ever deny that some flags produce broken code? I did however deny the feasibility your ridiculous solution to said problem and outlined futher issues that your "solution" would not do anything to solve, thus being anything but "close enough".

Notice that you've been ranting for five posts, yet you claim to be only talking about the one in my previous post. Where did the others go?

Yes, I noticed that. Bad habit of mine, I'm afraid. I'll try to curtail it. Anyway, don't you mean four posts? Of which only the last two has been directed towards you specifically, due to my disagreement with the post you made (quoted in my post directed to you). You first write that "Perfect ANSI C has been known to break because -ffast-math thinks it should be something else.", and then goes on to state that just using ANSI C together with proper programming habits is "close enough". That is what I disagree with.

racoontje wrote:
Quote:
Also, your sarcasm-fu is weak!

You're 14, right? Don't answer that. We all know the answer and we all know you'll lie.

No answer for you then. :)

racoontje wrote:
Plus, there IS plenty of code that wouldn't break under certain circumstances if implemented otherwise. If you don't want to call 'otherwise' 'properly', be my guest.

The problem is of course that not only will improper code break, proper code break as well due to errornous optimizations. Plus, if the toolchain itself has been compiled with defect optimizations, you risk getting faults in code that would otherwise work. Everything goes.
Back to top
View user's profile Send private message
lamaistres
Apprentice
Apprentice


Joined: 17 Dec 2002
Posts: 268
Location: Seattle

PostPosted: Fri Apr 01, 2005 6:03 am    Post subject: Reply with quote

Can someone give me the name of an ebuild that breaks when I compile with -ffast-math. I'm just curious.
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: Fri Apr 01, 2005 9:20 am    Post subject: Reply with quote

Quote:
"-march=pentium3 -O2 -fweb -pipe -fomit-frame-pointer -ftracer -fforce-addr -ftree-vectorize -ftree-vectorizer-verbose=1 "


8O can anyone explain to me wat is this vectorizer thingy doing there....i thought it something got to do with graphics thing...if it is...can i compile it with gimp??
_________________
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
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  Next
Page 8 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