Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Flags for compiling a kernel
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
fmalabre
Guru
Guru


Joined: 19 Jun 2002
Posts: 376
Location: Chicago

PostPosted: Mon Jun 24, 2002 11:03 pm    Post subject: Flags for compiling a kernel Reply with quote

Hi,

How to set up the flag for compiling my kernel?
I set up the CFLAG variable, and it's also in my make.conf file, but when I do my make bzImage, it doens't use my flags...
Where my flags should go?

Thanks,
Fred.
Back to top
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Mon Jun 24, 2002 11:17 pm    Post subject: Reply with quote

  1. What does your make.conf look like (just the relevant CHOST/CFLAGS/CXXFLAGS section)
  2. What makes you think the kernel isn't being compiled with your flags?
  3. Have you selected the proper CPU architecture in your kernel config when you were doing 'make menuconfig'?
--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
fmalabre
Guru
Guru


Joined: 19 Jun 2002
Posts: 376
Location: Chicago

PostPosted: Mon Jun 24, 2002 11:27 pm    Post subject: Reply with quote

in my make.comf file, I have:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O3 -pipe -fforce-addr -fomit-frame-pointer -funroll-loops -frerun-loop-opt -frerun-cse-after-loop -malign-functions=4"
CXXFLAGS="-march=i686 -O3 -pipe -fforce-addr -fomit-frame-pointer -funroll-loops -frerun-loop-opt -frerun-cse-after-loop -malign-functions=4"

When I do make make bzImage, I have:
earth linux # make bzImage
. scripts/mkversion > .tmpversion
gcc -D__KERNEL__ -I/usr/src/linux-2.4.18/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DUTS_MACHINE='"i386"' -DKBUILD_BASENAME=version -c -o init/version.o init/version.c
make CFLAGS="-D__KERNEL__ -I/usr/src/linux-2.4.18/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 " -C kernel
make[1]: Entering directory `/usr/src/linux-2.4.18/kernel'
make all_targets
make[2]: Entering directory `/usr/src/linux-2.4.18/kernel'
gcc -D__KERNEL__ -I/usr/src/linux-2.4.18/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DKBUILD_BASENAME=resource -c -o resource.o resource.c

As you can see, it use -O2 and I specified -O3.
I selected the proper CPU arch in my kernel config.

I checked the make file for the kernel (I have the vanilla 2.4.18), and actually I see hard coded the flag its' using.
Haven't found a way to make it use my own flag.
I just wonder if someone ever compile a kernel with its own flags, and how?

Thanks for your help,
Fred.
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