Re: how to build kernel with -O option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 29 October 2008 14:10:33 loody wrote:
> Dear all:
> I try to build a kernel with -O and I try to modify below lines in
> Makefile:
>
> ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
> KBUILD_CFLAGS   += -O
> else
> KBUILD_CFLAGS   += -O
> endif

With -O, the compiler tries to reduce code size and execution time, without 
performing any optimizations that take a great deal of compilation time.

As to why this fails, I don't know. When I change my Makefile to reflect 
yours, and run a build with defconfig, It compiles without errors

Which version are you using? (I use git head, e946217e4f)

>
> but the result will fail like below.
>
> calibrate.c:(.init.text+0x1338): undefined reference to
> `__you_cannot_kmalloc_that_much'
> init/built-in.o: In function `rd_load_image':
> calibrate.c:(.init.text+0x1810): undefined reference to
> `__you_cannot_kmalloc_that_much'
> init/built-in.o: In function `crd_load':
> calibrate.c:(.init.text+0x3da0): undefined reference to
> `__you_cannot_kmalloc_that_much'
> calibrate.c:(.init.text+0x3ef4): undefined reference to
> `__you_cannot_kmalloc_that_much'
> kernel/built-in.o: In function `call_usermodehelper_setup':
> utsname_sysctl.c:(.text+0x15b38): undefined reference to
> `__you_cannot_kmalloc_that_much'
> kernel/built-in.o:utsname_sysctl.c:(.text+0x16c70): more undefined
> references to `__you_cannot_kmalloc_that_much' follow
> make[1]: *** [.tmp_vmlinux1] Error 1
> make[1]: Leaving directory `/mnt/hdb/uclinux/uClinux-dist/linux-2.6.x'
> make: *** [linux] Error 1

this looks like a linker issue, or some unresolved .o files (do you include 
a .h file without building the objectfile?)

> Is there any possibilities to build a kernel with -O version?
> appreciate your help,

yes, you can specify this in the menu
Per default, you either optimize for size (general_setup -> optimize for 
size) -Os, or you optimze at -O2

> miloody
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ



-- 
med Vennlig Hilsen - Yours Sincerely
Henrik Austad

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux