Gentoo USE and CFLAGS recommendations?

Just setup a linode today and I'm currently using Gentoo (the only distro I know). I have a couple other Gentoo servers at home and work and the CFLAGS I've been using are CFLAGS="-O3 -march= <whatever.arch.it.is>-fomit-frame-pointer -pipe"</whatever.arch.it.is>
Are there any CFLAGS I should use or avoid on my linode?

What about USE flags?

7 Replies

This is what I've added to my make.conf file:

USE="apache2 cjk fam gd imagemagick imap maildir mysql sasl unicode -oss -alsa -apm -arts -avi -cups -encode -foomaticdb -gpm -gtk -gtk2 -imlib -kde -gnome -libg++ -mad -mikmod -motif -mpeg -oggvorbis -opengl -qt -quicktime -sdl -svga -truetype -X -xmms -xv"

I haven't changed the CFLAGS, and I'm not sure what I'd change them for anyway.

.

I'm no programmer so I don't really know what they all mean, but I think the CFLAGS have to do with compiler optimizations. Check out this thread from the Gentoo Forums. I was hoping someone might be able to recommend some CFLAGS that would be beneficial in a UML environment… cuz this stuff is all Greek to me.

Oh.. and from what I understand.. adding atleast "-fomit-frame-pointer" boosts performance or memory usage or something… and it's a pretty "safe" CFLAG to use, so why not? Anyone else have recommendations or advice?

At home I use:

CFLAGS="-O2 -march=pentium3 -fprefetch-loop-arrays -pipe"

Although you most likely want -march=athlon-xp instead of -march=pentium3 on your linode.

-O3 often isn't faster than -O2. Try it and see.

Personally I would rather use debian on a linode. Gentoo may be a great system but it use a fair old amount of space for the portage tree.

-fomit-frame-pointer disables the use of a CPU register as a frame pointer. Upside: having another register available makes software run faster (less frequent access to memory). Downside: stack trace debugging is disabled - but you probably don't care unless you are developing or seriously testing software on your Linode.

@sednet:

Although you most likely want -march=athlon-xp instead of -march=pentium3 on your linode.
Linodes are dual Xeon boxes so -march=pentium3 is presumably the way to go.

Tinkering with CFLAGS is a surprisingly easy way of building software that bombs in obscure circumstances. Unless you are doing something very unusual with your Linode, you will be I/O bound, not processor bound and I would stick with the defaults.

I would assume caker set some good defaults for the CFLAGS, so I have never looked into changing them…

The USE flags on the other hand could use some tweaking in the default setup. They are very desktop-centric, which is probably not what most people want/need from a Linode…

@pclissold:

Tinkering with CFLAGS is a surprisingly easy way of building software that bombs in obscure circumstances. Unless you are doing something very unusual with your Linode, you will be I/O bound, not processor bound and I would stick with the defaults.

Good point… I don't consider my CFLAGS to be overly aggressive so I think I'm fine for now… I don't plan to tinker with them anymore.

@wazdog:

I would assume caker set some good defaults for the CFLAGS, so I have never looked into changing them…
Actually, in my Gentoo setup I didn't notice any CFLAGS at all.

@lurkus:

Actually, in my Gentoo setup I didn't notice any CFLAGS at all.
CFLAGS are set in /etc/make.globals.

emerge info will tell you what your defaults are - my Linode gives CFLAGS="-O2 -mcpu=i686 -pipe" which is unchanged since distro install and pretty conservative.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct