Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Compile 2.4.18 Kernel with -O3 -pipe?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
gentoo-fan
Guest





PostPosted: Fri Jun 14, 2002 8:47 pm    Post subject: Compile 2.4.18 Kernel with -O3 -pipe? Reply with quote

Is it a good idea to compile the Kernel
(e.g. 2.4.18) with the -O3 -pipe flags?

Thanks!


gentoo-fan
Back to top
maystorm
Apprentice
Apprentice


Joined: 02 Jun 2002
Posts: 215
Location: Germany, not far away

PostPosted: Sun Jun 16, 2002 12:31 am    Post subject: Reply with quote

Most probably not... not sure, though... don't want to be a dead hero, either... :roll:
_________________
Linux user #216018
Back to top
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Sun Jun 16, 2002 1:30 pm    Post subject: Reply with quote

Never had any problems with it.
Back to top
View user's profile Send private message
dmmgentoo
n00b
n00b


Joined: 16 Jun 2002
Posts: 38

PostPosted: Sun Jun 16, 2002 7:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vanquirius
Retired Dev
Retired Dev


Joined: 14 Jun 2002
Posts: 1297
Location: Ethereal plains

PostPosted: Sun Jun 16, 2002 8:19 pm    Post subject: Reply with quote

works fine here
Back to top
View user's profile Send private message
thomson
n00b
n00b


Joined: 01 Sep 2002
Posts: 25

PostPosted: Sun Sep 01, 2002 8:12 pm    Post subject: optimization flag not transmitted into kernel? Reply with quote

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
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sun Sep 01, 2002 8:20 pm    Post subject: Re: optimization flag not transmitted into kernel? Reply with quote

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
View user's profile Send private message
thomson
n00b
n00b


Joined: 01 Sep 2002
Posts: 25

PostPosted: Sun Sep 01, 2002 8:24 pm    Post subject: Reply with quote

thank you! will give it a try, but still keep the default kernel in /boot and grub jic.
Back to top
View user's profile Send private message
sn1987a
n00b
n00b


Joined: 30 Aug 2002
Posts: 26
Location: Houston Tx

PostPosted: Mon Sep 02, 2002 12:07 am    Post subject: Reply with quote

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
View user's profile Send private message
helmers
Guru
Guru


Joined: 16 Sep 2002
Posts: 548
Location: Oslo, Norway

PostPosted: Fri Sep 20, 2002 8:27 am    Post subject: Reply with quote

Would it be possible to add "march=athlon-xp" in here? And will it then make use of sse? :o
Back to top
View user's profile Send private message
de4d
Apprentice
Apprentice


Joined: 12 Sep 2002
Posts: 181
Location: fr. i. br. (ger)

PostPosted: Fri Sep 20, 2002 8:45 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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