View previous topic :: View next topic |
Author |
Message |
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Mon Dec 02, 2002 11:44 pm Post subject: [FAQF] KC14: Kernel compiling, CFLAGS and make.conf settings |
|
|
Thanks, int1.
If the Gentoo developers wanted to make the make.conf CFLAGS apply to the kernel as well, they could rather easily (lostlogic patches the kernel fairly heavily as it is ). So I don't think it's really the distribution indpendence that's the reason the kernel CFLAGS are kept separate. I think it's simply the fact that the kernel has its own set of rather demanding restrictions and opinions about which flags it should be compiled with, that are independent of the choices made at the application level. I could certainly be wrong on this point, however.
It's also not necessary to edit Makefiles at all to change kernel CFLAGS, although that is one way to do it. Another way is to define the CFLAGS_KERNEL envariable when you compile. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
int1 Tux's lil' helper
Joined: 08 Nov 2002 Posts: 139
|
Posted: Mon Dec 02, 2002 11:50 pm Post subject: |
|
|
Didn't know that one. Thanks for the tip!
int1
PS> I can rewrite this with your tip if you'd like. |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Mon Dec 02, 2002 11:59 pm Post subject: |
|
|
int1 wrote: | PS> I can rewrite this with your tip if you'd like. |
Any time you'd like. If you'd prefer to wait some time for more feedback here, that's OK, too. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
zypher Retired Dev
Joined: 10 Jun 2002 Posts: 416 Location: Cologne, ger.
|
Posted: Fri Dec 06, 2002 6:56 am Post subject: |
|
|
BTW: My kernel compilation warns about -malign-functions is obsolete and you should use -falign-functions (on 2.3.18-wolk3.8, which really should be in portage one day...).
Does this mean the function is translated to -falign-functions or is it discarded?
I'll change the Makefile and try it again anyway, just curious. _________________ linux user 65882 |
|
Back to top |
|
|
ebrostig Bodhisattva
Joined: 20 Jul 2002 Posts: 3152 Location: Orlando, Fl
|
Posted: Sat Dec 07, 2002 1:30 am Post subject: |
|
|
zypher wrote: | BTW: My kernel compilation warns about -malign-functions is obsolete and you should use -falign-functions (on 2.3.18-wolk3.8, which really should be in portage one day...).
Does this mean the function is translated to -falign-functions or is it discarded?
I'll change the Makefile and try it again anyway, just curious. |
2.3.18 wow! That is old! LOL
The reason is that the compiler flags changed with the gcc 3.x release and the old 2.3.x series of the kernel is not updated to be aware of this fact. besides, the 2.3.x series was the development series for 2.4.x and should not be used anymore.
Why such an old kernel?
Erik |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Sat Dec 07, 2002 7:14 am Post subject: |
|
|
I think it's a typo of 2.4.18. -malign-functions changed names to -falign-functions somewhere between GCC 2.95 and 3.2. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
Zu` l33t
Joined: 26 May 2002 Posts: 716 Location: BE
|
Posted: Mon Dec 09, 2002 8:46 pm Post subject: |
|
|
This is interesting, but I wonder if it's worth it ? Especially since the configuration of your kernel (.config) will specify the arch. (-march=athlon in my case, while I compile everthing else with -march=athlon-xp.)
So what's useable? -O3 ? -fomit-frame-pointer ?
Are there any real advantages of compiling the kernel with modified CFLAGS? I.e. noticeable speed increase, or other .. ?
For the ones who have tested this, is it worth bothering with ?
Thanks. |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Mon Dec 09, 2002 9:25 pm Post subject: |
|
|
Oh, yeah. Thanks, Zu'. Thanks for reminding me. There should probably also be something in here about the GCC3 patch in recent gentoo-sources, which adds "gcc 3+" options to the processor types config option. That allows another way to change -march. And, just to make sure things are clear, Zu', the point of this FAQ is not to encourage people to mess around with kernel CFLAGS, it's just that there have been several people that got confused by the fact that the kernel is not compiled with the CFLAGS in make.conf. They assumed that the kernel is just like any other software being compiled by portage, but it's not. This confusion has made some kernel compilation threads get confusing, when people start asking about and changing CFLAGS when it doesn't have any effect. That's why this FAQ entry was born. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
Zu` l33t
Joined: 26 May 2002 Posts: 716 Location: BE
|
Posted: Mon Dec 09, 2002 10:36 pm Post subject: |
|
|
Thanks for clarifying rac.
I'm using vanilla-sources and I wasn't aware of that patch in the gentoo-sources. I'll have a look at it. I wonder if it just sets the -march or 'forces' even more optimalisation.
About the FAQ, yes I see how it's meant to be used. Still, It'd be interesting to hear from people who have modified their kernel CFLAGS. Nevertheless, this isn't necessarily the right place to discuss this, we better keep FAQ's somewhat clean
Regards,
zu |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Mon Dec 09, 2002 10:49 pm Post subject: |
|
|
Zu` wrote: | I wonder if it just sets the -march or 'forces' even more optimalisation. | AFAIK, it just sets -march.
Quote: | Nevertheless, this isn't necessarily the right place to discuss this, we better keep FAQ's somewhat clean | Don't worry about that. This is a fine place for feedback on this issue. In the end, int1 (or somebody who takes over as maintainer) will just keep editing the first post in this thread, and eventually that first post will be split into its own thread in the FAQ forum. The rest of this discussion will stay here or go somewhere else, but it won't clutter up the eventual FAQ answer. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
int1 Tux's lil' helper
Joined: 08 Nov 2002 Posts: 139
|
Posted: Sat Dec 14, 2002 1:29 am Post subject: |
|
|
Zu` wrote: | So what's useable? -O3 ? -fomit-frame-pointer ? |
The above options I use as an example are my real kernel compile options, so both work plus some others.
PS> I updated the FAQ....
Thanks to all for comments!
int1 |
|
Back to top |
|
|
int1 Tux's lil' helper
Joined: 08 Nov 2002 Posts: 139
|
Posted: Sat Jan 25, 2003 6:51 pm Post subject: |
|
|
Noticed this still isn't linked in the FAQ. Any specific reason?
int1 |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Sat Jan 25, 2003 6:56 pm Post subject: |
|
|
int1 wrote: | Noticed this still isn't linked in the FAQ. Any specific reason? | Sorry about that. I'll get to it right now. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
cazze Apprentice
Joined: 26 Mar 2003 Posts: 155 Location: Brussels - Belgium
|
Posted: Wed Mar 26, 2003 10:33 pm Post subject: |
|
|
Hi,
i tried to add -march=i586 for my c3 ezra processor in the Makefile, but with the compile, i got -march=i586 (the one i added) AND -march=i486.
i think it's important to say that if you change something like -march in your Makefile, you have to edit your .config file and deselect all the possible processors.
you can see wich flags are added for your processor in arch/i386(in my case)/Makefile
Hope this will help
kammicazze |
|
Back to top |
|
|
bushwacker n00b
Joined: 22 Feb 2004 Posts: 37 Location: Tacoma, WA
|
Posted: Sun May 09, 2004 4:00 am Post subject: |
|
|
is this information safe to use with the 2.6.x kernel line? I'd like to optimize my kernel a bit, but I dont want to do anything crazy until I know if/what settings can be applied. I have an Athlon XP CPU, so I"d like to use (if possible):
Code: | -03 -march=athlon-xp -pipe -formit-frame-pointer -funroll-loops |
I have other options enabled in /etc/make.conf for general apps, most notably -mmmx, -m3dnow, and -msse. Could these safely be added as well?
Thanks. _________________ Give me $, you insensitive clod! |
|
Back to top |
|
|
wdreinhart Guru
Joined: 11 Jun 2003 Posts: 569 Location: 4QFJ12345678
|
Posted: Sun May 09, 2004 4:54 am Post subject: |
|
|
-mmmx -msse and -m3dnow are implied by -march=athlon-xp. You don't really need them anywhere. |
|
Back to top |
|
|
bushwacker n00b
Joined: 22 Feb 2004 Posts: 37 Location: Tacoma, WA
|
Posted: Sun May 09, 2004 10:17 pm Post subject: |
|
|
right now I'm recompiling some KDE Arts library stuff (kde startup segfault, various apps not running because of missing libs, etc), and its taking *much* longer than it did originally. Is -march=xxxx known to take a lot longer than -mcpu=xxxx to operate? _________________ Give me $, you insensitive clod! |
|
Back to top |
|
|
bushwacker n00b
Joined: 22 Feb 2004 Posts: 37 Location: Tacoma, WA
|
Posted: Sat May 15, 2004 12:09 am Post subject: |
|
|
applying KERNEL_CFLAGS could be done by putting the following in /etc/make.conf, right?
KERNEL_CFLAGS="MY_COMPILE_PARAMETERS_HERE"
It seems to be going ok, but the new kernel 2.6.x build script doesn't show you the compilation data like the older kernels always did. Is there a way to show this info, too, BTW?
Thanks. _________________ Give me $, you insensitive clod! |
|
Back to top |
|
|
Master_Of_Disaster l33t
Joined: 28 Feb 2003 Posts: 610 Location: 15.05072° East, 48.13747° North (aka Mauer), Austria
|
Posted: Sat May 15, 2004 12:18 am Post subject: |
|
|
bushwacker wrote: | It seems to be going ok, but the new kernel 2.6.x build script doesn't show you the compilation data like the older kernels always did. Is there a way to show this info, too, BTW? |
make V=1 _________________ post tenebras lux, post fenestras tux
Registered Linux User Nr. 312509
Adopt an unanswered post today! |
|
Back to top |
|
|
phreaqy n00b
Joined: 03 May 2004 Posts: 16 Location: Canada
|
Posted: Mon May 17, 2004 2:49 pm Post subject: |
|
|
Nobody seem to post if the kernel CFLAGS actually have a speed increase, so has anybody that tried this noticed a speed increase? _________________ AMD TBIRD 1.33
256 mb RAM
kenel 2.6.7-love2
Soundblaster 16 PCI
Nvidia GeForce 3 Ti |
|
Back to top |
|
|
bushwacker n00b
Joined: 22 Feb 2004 Posts: 37 Location: Tacoma, WA
|
Posted: Tue May 18, 2004 6:02 pm Post subject: |
|
|
The kernel seems to perform a bit better in terms of task switching/vm/cpu time/etc. I'm not sure if this is just because it's the 2.6x kernel as opposed to the 2.4 though. There seems to be a larger performance boost between stock 2.4 and stock 2.6 than between stock 2.6 and optimized 2.6 kernels. _________________ Give me $, you insensitive clod! |
|
Back to top |
|
|
phreaqy n00b
Joined: 03 May 2004 Posts: 16 Location: Canada
|
Posted: Tue May 18, 2004 11:19 pm Post subject: |
|
|
Thanks Man _________________ AMD TBIRD 1.33
256 mb RAM
kenel 2.6.7-love2
Soundblaster 16 PCI
Nvidia GeForce 3 Ti |
|
Back to top |
|
|
bushwacker n00b
Joined: 22 Feb 2004 Posts: 37 Location: Tacoma, WA
|
Posted: Wed May 19, 2004 5:28 am Post subject: |
|
|
NP. Let me know if you notice any positive results w/ this. _________________ Give me $, you insensitive clod! |
|
Back to top |
|
|
dj_farid l33t
Joined: 14 Jun 2004 Posts: 613
|
Posted: Tue Aug 10, 2004 10:44 pm Post subject: |
|
|
Any results? |
|
Back to top |
|
|
DRZIN Tux's lil' helper
Joined: 15 Feb 2006 Posts: 114
|
Posted: Sun Apr 30, 2006 7:48 am Post subject: how to edit the make.conf |
|
|
i belive all my issue that have been having is becouse my make.conf is not set up right please help!
what is differentes between menuconfig and make.conf _________________ AUDIO ENEGINEERING and trying to take over the world with Techno |
|
Back to top |
|
|
|