View previous topic :: View next topic |
Author |
Message |
fmalabre Guru
Joined: 19 Jun 2002 Posts: 376 Location: Chicago
|
Posted: Mon Jun 24, 2002 11:03 pm Post subject: Flags for compiling a kernel |
|
|
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 |
|
|
klieber Bodhisattva
Joined: 17 Apr 2002 Posts: 3657 Location: San Francisco, CA
|
Posted: Mon Jun 24, 2002 11:17 pm Post subject: |
|
|
- What does your make.conf look like (just the relevant CHOST/CFLAGS/CXXFLAGS section)
- What makes you think the kernel isn't being compiled with your flags?
- 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 |
|
|
fmalabre Guru
Joined: 19 Jun 2002 Posts: 376 Location: Chicago
|
Posted: Mon Jun 24, 2002 11:27 pm Post subject: |
|
|
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.1, 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 |
|
|
|