View previous topic :: View next topic |
Author |
Message |
gentoo-fan Guest
|
Posted: Fri Jun 14, 2002 8:47 pm Post subject: Compile 2.4.18 Kernel with -O3 -pipe? |
|
|
Is it a good idea to compile the Kernel
(e.g. 2.4.1 with the -O3 -pipe flags?
Thanks!
gentoo-fan |
|
Back to top |
|
|
maystorm Apprentice
Joined: 02 Jun 2002 Posts: 222 Location: Germany, not far away
|
Posted: Sun Jun 16, 2002 12:31 am Post subject: |
|
|
Most probably not... not sure, though... don't want to be a dead hero, either... _________________ Linux user #216018 |
|
Back to top |
|
|
AlterEgo Veteran
Joined: 25 Apr 2002 Posts: 1619
|
Posted: Sun Jun 16, 2002 1:30 pm Post subject: |
|
|
Never had any problems with it. |
|
Back to top |
|
|
dmmgentoo n00b
Joined: 16 Jun 2002 Posts: 38
|
Posted: Sun Jun 16, 2002 7:26 pm Post subject: |
|
|
I'd recommend no higher than -O2. I think it's counter-productive to use -O3, because it inlines everything in sight. This bloats the code, and causes the apps to consume more memory. Surely, you want the kernel to be as small/fast as possible? I think -O2 is the safest bet, unless you absolutely positively need to squeeze every once of performance out of the app you're compiling. Also, remember that higher optimization levels lead to longer compile times. |
|
Back to top |
|
|
Vanquirius Retired Dev
Joined: 14 Jun 2002 Posts: 1297 Location: Ethereal plains
|
Posted: Sun Jun 16, 2002 8:19 pm Post subject: |
|
|
works fine here |
|
Back to top |
|
|
thomson n00b
Joined: 01 Sep 2002 Posts: 25
|
Posted: Sun Sep 01, 2002 8:12 pm Post subject: optimization flag not transmitted into kernel? |
|
|
I have CFLAGS in my /etc/make.conf set to -march=pentium -O3 -pipe for a laptop I'm compiling a system on.
I'm using the gentoo-sources 2.4.19-r7
when I'm compiling the kernel (make clean dep bzImage modules) I see the -march=pentium flag is being passed, but the -O stays at -O2.
Any idea what's happening here? Or, since I'm not doing the compile via emerge, do I need to go in and change each of the Makefiles in the linux tree?
thx! |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Sun Sep 01, 2002 8:20 pm Post subject: Re: optimization flag not transmitted into kernel? |
|
|
thomson wrote: | Any idea what's happening here? Or, since I'm not doing the compile via emerge, do I need to go in and change each of the Makefiles in the linux tree? |
CFLAGS don't affect kernel compilation. The kernel in my experience has good reasons for choosing what compiler flags it is compiled with, and I would recommend leaving it alone. That being said, if you really want to change things, Code: | $ make bzImage CFLAGS_KERNEL="-O9 -fgo-crazy" | ...might be what you are looking for. If you do decide to go this route, and you have problems with instability or anything, please make sure that the problem persists even with the kernel compiled with default optimizations before reporting bugs. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
thomson n00b
Joined: 01 Sep 2002 Posts: 25
|
Posted: Sun Sep 01, 2002 8:24 pm Post subject: |
|
|
thank you! will give it a try, but still keep the default kernel in /boot and grub jic. |
|
Back to top |
|
|
sn1987a n00b
Joined: 30 Aug 2002 Posts: 26 Location: Houston Tx
|
Posted: Mon Sep 02, 2002 12:07 am Post subject: |
|
|
According to "Documentation/Changes":
Quote: | In addition, please pay attention to compiler optimization. Anything
greater than -O2 may not be wise. |
Having said that, the gcc man page indicates that the only difference between -O2 and -O3 is that -O3 includes -finline-functions. The kernel is already very carefully inlined. The compiler may not find additional candidates for inlining.
There is usually a reason for the code in the kernel to be setup in a certain way and you may not want the compiler second guessing the developers. |
|
Back to top |
|
|
helmers Guru
Joined: 16 Sep 2002 Posts: 553 Location: Stange, Norway
|
Posted: Fri Sep 20, 2002 8:27 am Post subject: |
|
|
Would it be possible to add "march=athlon-xp" in here? And will it then make use of sse? |
|
Back to top |
|
|
de4d Apprentice
Joined: 12 Sep 2002 Posts: 181 Location: fr. i. br. (ger)
|
Posted: Fri Sep 20, 2002 8:45 am Post subject: |
|
|
helmers wrote: | Would it be possible to add "march=athlon-xp" in here? And will it then make use of sse? :o |
--march=atlon-xp works fine for me (gcc 3.2r1, kernel2.4.19r9)
i cannot promise this is using sse, but i think so _________________ void main(){fork();main();} |
|
Back to top |
|
|
|