Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Gentoo Chat
  • Search

Time to debug those CFLAGS people

Opinions, ideas and thoughts about Gentoo. Anything and everything about Gentoo except support questions.
Post Reply
  • Print view
Advanced search
26 posts
  • 1
  • 2
  • Next
Author
Message
hensan
l33t
l33t
User avatar
Posts: 868
Joined: Thu Jun 26, 2003 9:24 pm
Location: Sweden

Time to debug those CFLAGS people

  • Quote

Post by hensan » Thu Oct 30, 2003 12:40 pm

I just saw on the gentoo portage stats page that some 3% of the people who have posted their clags there use -03 (zero three, wrong) instead of -O3 (big O three, right) in their CFLAGS, thereby making it the 20th most popular flag. :roll:
Top
frippz
Guru
Guru
User avatar
Posts: 460
Joined: Thu Aug 22, 2002 3:08 pm
Location: Sweden
Contact:
Contact frippz
Website

  • Quote

Post by frippz » Thu Oct 30, 2003 1:30 pm

Oh dear...
Those poor people! :mrgreen:
Top
guy
Apprentice
Apprentice
User avatar
Posts: 286
Joined: Mon Mar 31, 2003 1:35 am
Location: USA
Contact:
Contact guy
Website

  • Quote

Post by guy » Thu Oct 30, 2003 1:42 pm

*Levi* wrote:Oh dear...
Those poor people! :mrgreen:
I definitely did that my first install but was to ashamed to mention it :oops:
www.manatee.servemp3.com
www.seas.upenn.edu/~bdodson/gina
www.goatse.cx [it will rise again!]
Top
Moofed
Apprentice
Apprentice
User avatar
Posts: 158
Joined: Tue Oct 22, 2002 3:52 am
Location: Bloomington, IN

  • Quote

Post by Moofed » Thu Oct 30, 2003 1:45 pm

:roll:
And only ~55% use -pipe?! Is there a reason to not use -pipe?
Top
Andersson
Guru
Guru
User avatar
Posts: 525
Joined: Sat Jul 12, 2003 10:00 pm
Location: Göteborg, Sweden

  • Quote

Post by Andersson » Thu Oct 30, 2003 5:55 pm

That is because many people don't bother setting the cflags at all.
Top
TPC
Tux's lil' helper
Tux's lil' helper
Posts: 135
Joined: Tue Sep 16, 2003 2:01 pm
Location: Sweden
Contact:
Contact TPC
Website

  • Quote

Post by TPC » Thu Oct 30, 2003 6:36 pm

10% use -march=pentium4? I thought that was broken? is it fixed?
Top
Zeitgeist
Apprentice
Apprentice
User avatar
Posts: 165
Joined: Thu Mar 13, 2003 12:06 am
Location: Ouagadougou, Burkina Faso

  • Quote

Post by Zeitgeist » Thu Oct 30, 2003 7:43 pm

-O2 is faster anyway...
Top
Xaignar
Apprentice
Apprentice
User avatar
Posts: 153
Joined: Wed Jun 11, 2003 6:54 pm
Location: Denmark

  • Quote

Post by Xaignar » Thu Oct 30, 2003 7:57 pm

TPC wrote:10% use -march=pentium4? I thought that was broken? is it fixed?
It's fixed in the newer versions of gcc.
Top
Evangelion
Veteran
Veteran
User avatar
Posts: 1087
Joined: Fri May 31, 2002 8:53 am
Location: Helsinki, Finland

  • Quote

Post by Evangelion » Thu Oct 30, 2003 8:12 pm

If you are interested in optimizations, then I suggest that you read this
My tech-blog | My other blog
Top
Athas
Guru
Guru
User avatar
Posts: 394
Joined: Thu Sep 04, 2003 6:00 pm
Location: Brøndby, Denmark
Contact:
Contact Athas
Website

  • Quote

Post by Athas » Thu Oct 30, 2003 8:35 pm

Another thing I wonder about, is why more people put "gtk2" in their USE-flags than "X" :?
Emacs-optimized danish console keymap - My .emacs
Climacs - next generation Emacs.
Top
so
Retired Dev
Retired Dev
User avatar
Posts: 115
Joined: Mon Sep 08, 2003 10:50 am
Location: Roma
Contact:
Contact so
Website

  • Quote

Post by so » Thu Oct 30, 2003 9:52 pm

Athas wrote:Another thing I wonder about, is why more people put "gtk2" in their USE-flags than "X" :?
me too :o
Top
thrasher6670
Apprentice
Apprentice
User avatar
Posts: 269
Joined: Mon Aug 04, 2003 3:23 am
Location: London, Ontario
Contact:
Contact thrasher6670
Website

  • Quote

Post by thrasher6670 » Fri Oct 31, 2003 2:55 am

so wrote:
Athas wrote:Another thing I wonder about, is why more people put "gtk2" in their USE-flags than "X" :?
me too :o
Well is is implied if not specifically specified :).

wow, people talking about my site. cool.
anything else people would like to see in the stats?
Gentoo-Portage.com - Where the portage meets the web
Gentoo Wiki
Top
QPegasus
n00b
n00b
User avatar
Posts: 42
Joined: Sat Sep 27, 2003 10:58 pm

  • Quote

Post by QPegasus » Fri Oct 31, 2003 3:43 am

Andersson wrote:That is because many people don't bother setting the cflags at all.
Isnt -pipe enabled by default, along with -O3 and whatever processor you have?

Although, I guess a lot of people update portage, etc-update, wipe their old make.conf and dont bother transferring over their CFLAGS/USE settings. 8O

I can understand if many people dont care about such things though, and just use Gentoo because of the number of packages in portage. :D
Top
zez
Apprentice
Apprentice
User avatar
Posts: 256
Joined: Thu Jun 13, 2002 8:59 pm
Location: Oregon, United States

  • Quote

Post by zez » Fri Oct 31, 2003 4:20 am

Athas wrote:Another thing I wonder about, is why more people put "gtk2" in their USE-flags than "X" :?
Actually X is listed in make.defaults so it should be on by default, right?
Top
meowsqueak
Veteran
Veteran
User avatar
Posts: 1549
Joined: Tue Aug 26, 2003 6:46 am
Location: New Zealand

  • Quote

Post by meowsqueak » Fri Oct 31, 2003 6:15 am

Yeah, the stats script isn't smart enough to consider those USE flags on by default. I could probably make it do that, but it depends on what the statistics are actually trying to convey...
Top
CheshireCat
Guru
Guru
User avatar
Posts: 572
Joined: Sun Aug 25, 2002 11:06 pm

  • Quote

Post by CheshireCat » Fri Oct 31, 2003 8:15 am

dlpierce wrote::roll:
And only ~55% use -pipe?! Is there a reason to not use -pipe?
-pipe can be slower. I believe this depends on kernel version, and probably on the code being compiled, but pipes can be slower than small temp files, which will often never get written to disk at all.
Top
thrasher6670
Apprentice
Apprentice
User avatar
Posts: 269
Joined: Mon Aug 04, 2003 3:23 am
Location: London, Ontario
Contact:
Contact thrasher6670
Website

  • Quote

Post by thrasher6670 » Sat Nov 01, 2003 5:54 am

i changed the script slightly, it was including people that had not set any useflags/cflags

should be more accurrate now.
Gentoo-Portage.com - Where the portage meets the web
Gentoo Wiki
Top
Chickpea
l33t
l33t
Posts: 846
Joined: Mon Jun 03, 2002 3:09 am
Location: Vancouver WA

  • Quote

Post by Chickpea » Sat Nov 01, 2003 7:11 am

Andersson wrote:That is because many people don't bother setting the cflags at all.
Maybe because we dont understand what they do....at least in my case that is. I have only recently started using them
Top
slarti`
Retired Dev
Retired Dev
User avatar
Posts: 376
Joined: Sat Sep 20, 2003 3:04 pm
Location: UK
Contact:
Contact slarti`
Website

  • Quote

Post by slarti` » Sat Nov 01, 2003 11:35 am

I really need to tidy my CFLAGS up. They work well, but I repeat myself quite a lot...

Code: Select all

CFLAGS="-march=athlon-xp -mmmx -msse -m3dnow -Os -pipe -fomit-frame-pointer -fforce-addr -fprefetch-loop-arrays -falign-functions=16 -falign-labels=1 -falign-loops=16 -falign-jumps=16 -fstack-protector -mfpmath=sse,387"
:?:

I think most of the -m*'s are implied by -march anyway, so I can probably get rid of those.

How many of these flags are already implied?
Gentoo/AMD64, shell-tools, net-mail, vim, recruiters
IRC: slarti @ irc.freenode.net
Devspace
Top
hensan
l33t
l33t
User avatar
Posts: 868
Joined: Thu Jun 26, 2003 9:24 pm
Location: Sweden

  • Quote

Post by hensan » Sat Nov 01, 2003 1:25 pm

sonic_ wrote:How many of these flags are already implied?
-mmmx, -msse and -m3dnow are implied by your -march

Also I see you use -Os, nothing wrong with that. But since you then explicitly enable all the flags that makes -Os different from -O2 (except -freorder-blocks), you might as well use -O2 and remove -falign-functions, -falign-jumps, -falign-loops, -falign-labels, -freorder-blocks and -fprefetch-loop-arrays. These flags have quite good values by default, so you don't really gain much by defining your own values.

I couldn't find -fstack-protector in the gcc documentation, whats that all about?
Top
Azaghal
Tux's lil' helper
Tux's lil' helper
Posts: 103
Joined: Fri May 02, 2003 6:26 pm

  • Quote

Post by Azaghal » Sat Nov 01, 2003 1:37 pm

I've yet to notice a difference between different CFLAGS... :roll:

And no, I don't use -03 :)
generatesig
Top
Stu_28
Tux's lil' helper
Tux's lil' helper
Posts: 129
Joined: Thu Jun 12, 2003 1:12 am

  • Quote

Post by Stu_28 » Sat Nov 01, 2003 1:55 pm

hensan wrote:
sonic_ wrote:How many of these flags are already implied?
-mmmx, -msse and -m3dnow are implied by your -march

Also I see you use -Os, nothing wrong with that. But since you then explicitly enable all the flags that makes -Os different from -O2 (except -freorder-blocks), you might as well use -O2 and remove -falign-functions, -falign-jumps, -falign-loops, -falign-labels, -freorder-blocks and -fprefetch-loop-arrays. These flags have quite good values by default, so you don't really gain much by defining your own values.

I couldn't find -fstack-protector in the gcc documentation, whats that all about?
You missed -fomit-frame-pointer, it's in all the O's. And the -fstack-protector is ProPolice ( http://www.research.ibm.com/trl/projects/security/ssp/ ).
Top
hensan
l33t
l33t
User avatar
Posts: 868
Joined: Thu Jun 26, 2003 9:24 pm
Location: Sweden

  • Quote

Post by hensan » Sat Nov 01, 2003 2:39 pm

From the GCC manual:
-O also turns on -fomit-frame-pointer on machines where doing so does not interfere with debugging.
x86 processors need the frame pointer for debugging, so -fomit-frame-pointer is not turned on by default.
Top
fp2099
Apprentice
Apprentice
User avatar
Posts: 261
Joined: Wed Oct 08, 2003 12:15 pm
Contact:
Contact fp2099
Website

errr...

  • Quote

Post by fp2099 » Thu Nov 06, 2003 11:11 pm

I actually use different flags for different things...
i used make.conf.stable to system and make.conf.optimum to world
make.conf.stable has
-mcpu=athlon-tbird -O2 -fomit-frame-pointer
and the other has
-march=athlon-tbird -O3 -pipe pipe-fforce-addr -fomit-frame-pointer -funroll-loops -falign-functions=4 -maccumulate-outgoing-args

At the time this seemed to be a smart move... now... er...
Top
curtis119
Bodhisattva
Bodhisattva
User avatar
Posts: 2160
Joined: Mon Mar 10, 2003 4:41 pm
Location: Toledo, Ohio,USA, North America, Earth, SOL System, Milky Way, The Universe, The Cosmos, and Beyond.

  • Quote

Post by curtis119 » Sat Nov 08, 2003 8:36 pm

I just wanted to say thank you for making the gentoo-portage website. It is a great resource and is a REAL improvement over the basic online portage database at gentoo.org. I hope that the developers (or the web-admin - whoever makes those decisions) will integrate it into gentoo.org. (hint hint).

Again Thanks for the great work!!




ps. I have tried a lot of different cflag combinations and the one that seems to give the best performance overall is "-march=pentium4 -Os -pipe -fomit-frame-pointer -msse2" It gives the fastest startup times to Gnome, the least amount of app crashes and everything just seems to run smoother (subjectivly speaking).

One of the things I noticed about using "-fexpensive-optimizations" is that Nautilus crashes when I delete something with the right-click menu, no matter what other flags are used.
Gentoo: it's like wiping your ass with silk.
Top
Post Reply
  • Print view

26 posts
  • 1
  • 2
  • Next

Return to “Gentoo Chat”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic