Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Hello, need help with gcc flags to my kernel....
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
jenkler
Apprentice
Apprentice


Joined: 28 Apr 2003
Posts: 222
Location: Sweden - Stockholm

PostPosted: Thu May 29, 2003 7:15 pm    Post subject: Hello, need help with gcc flags to my kernel.... Reply with quote

what do i need to write in my make.conf to get optimation flags

-03 .....

i have seen it somwhere... please help me.
_________________
Hello from me: Jenkler IT AB (swedish) (use google translate). Check out my Linux manpages for web in english.
Back to top
View user's profile Send private message
bmichaelsen
Veteran
Veteran


Joined: 17 Nov 2002
Posts: 1277
Location: Hamburg, Germany

PostPosted: Thu May 29, 2003 7:23 pm    Post subject: Reply with quote

since you didnt post what type of cpu you have....

look here
CFLAGS Central
Back to top
View user's profile Send private message
jenkler
Apprentice
Apprentice


Joined: 28 Apr 2003
Posts: 222
Location: Sweden - Stockholm

PostPosted: Thu May 29, 2003 7:53 pm    Post subject: No! i don´t meen thease flags.. Reply with quote

CHOST="i686-pc-linux-gnu"
CFLAGS="-mcpu=i686 -O3 -pipe"
CXXFLAGS="-mcpu=i686 -O3 -pipe"


there sould be a flag like,,,,


kernflags="super optimice" <--- something like this....

i want my kernel to be optiimised.....<--- i know "bad spelling"
_________________
Hello from me: Jenkler IT AB (swedish) (use google translate). Check out my Linux manpages for web in english.
Back to top
View user's profile Send private message
bmichaelsen
Veteran
Veteran


Joined: 17 Nov 2002
Posts: 1277
Location: Hamburg, Germany

PostPosted: Thu May 29, 2003 8:25 pm    Post subject: Reply with quote

optimization for the kernel is is done with make menuconfig when you choose the best architecture in Processortype and features/Processor family ...
Back to top
View user's profile Send private message
robmoss
Retired Dev
Retired Dev


Joined: 27 May 2003
Posts: 2634
Location: Jesus College, Oxford

PostPosted: Thu May 29, 2003 10:20 pm    Post subject: Reply with quote

I edited the Makefiles by hand.

If you edit about the 20th line and about the 91st line (depending on which version of the kernel you are using; I'm using the gentoo-sources 2.4.20 kernel) of the Makefile once you've unpacked the sources, you can change the default CFLAGS settings.

I know there's a prettier way to do this, and I think it involves make.conf, but I don't know it off hand. This method does work; it's the method I used when I was using an LFS (Linux From Scratch) system before I decided to have a go at Gentoo, and it's the method I still use now because I trust it...

Anyway, enjoy!
Back to top
View user's profile Send private message
Lovechild
Advocate
Advocate


Joined: 17 May 2002
Posts: 2858
Location: Århus, Denmark

PostPosted: Thu May 29, 2003 10:31 pm    Post subject: Reply with quote

do not mess with the kernels compile flags, it's written partly in asm and carefully inlined C - it's tweaked as close to the peak as humanly possible and the compiler will only fuck it up and make it slower.
Back to top
View user's profile Send private message
robmoss
Retired Dev
Retired Dev


Joined: 27 May 2003
Posts: 2634
Location: Jesus College, Oxford

PostPosted: Thu May 29, 2003 10:57 pm    Post subject: Reply with quote

Certainly true, but it's optimized for GCC 2.95.3, in a big way. So if you're using GCC 2.95.3, then leave well alone.

If you're not, then there's no real harm in letting the thing know about Athlon XP CPUs, for example (I think the gentoo patches do this too, but I'm not sure) so that you can use -march=athlon-xp instead of the plain old -march=athlon. That setting is hidden away somewhere in arch/i386/Makefile. Also, I make sure that -fomit-frame-pointer, -fforce-mem and -fforce-addr are always on in the base Makefile, as I have no need to debug the kernel, and -fforce-mem and -fforce-addr both create better code.

Obviously, going for -O3 is a bit silly as it bloats the code, so don't bother - the gratuitous loop unrolling does not help matters at all. -ffast-math will give you an unstable kernel (possibly even a kernel that won't boot) - not at all recommended.

If you want a bit more info on this, have a look at the [url=http://www.kernel.org/pub/linux/docs/lkml/#s8]linux-kernel mailing list FAQ[/url], and specifically section 8, entitled "Compiler/binutils questions". Section 8.4 tells you about optimizations.

If you really do want a fast kernel, compile it with GCC 2.95.3!
Back to top
View user's profile Send private message
jenkler
Apprentice
Apprentice


Joined: 28 Apr 2003
Posts: 222
Location: Sweden - Stockholm

PostPosted: Tue Jun 03, 2003 11:48 am    Post subject: Reply with quote

hmm, ok... but i cant still find anything.....


someone must know about the make.conf....



:-(
_________________
Hello from me: Jenkler IT AB (swedish) (use google translate). Check out my Linux manpages for web in english.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
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