Am Sonntag, den 02.11.2008, 14:50 +0800 schrieb loody: > > 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 > > > > My uclinux is uClinux-dist-20080808.tar.bz2, and toolchain is > > arm-linux-tools-20061213.tar.gz. > > 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' > > Hi: > I use gcc to compile normal linux kernel and it works. > I check where my problem comes from. > > the compile complain he cannot find the function call, > "__you_cannot_kmalloc_that_much." as below: > include/linux/slab_def.h:48: undefined reference to > `__you_cannot_kmalloc_that_much' > ...... > I grep the kernel source code, no matter normal linux or uclinux I > download, there is no definition of function call > "__you_cannot_kmalloc_that_much" in them.
You can't find the definition of this function because it isn't defined anywhere. It is used in the definition of kmalloc for constant size kmalloc arguments only. If the size is less or equal to the maximum allowed size, this part of the function is not used and is optimized away at compile time. If you compile without -O, it will probably stay there and cause a link error. > This makes me more curious. > In the beginning, I thought maybe uclinux change some prototype to > meet some requirement, since the .h file in uclinux called slab_def.h > instead of slab.h in normal kernel. > But I find both of them don't define the function. > > I know the unoptimized kernel is pretty big and useless under > practical situation but I want to trace assembly code of kernel and > the optimization will make me confuse. > Would someone have the problem before or find I lost something to set, > please let me know. > appreciate your kind help, I doubt that it is possible to compile the kernel without -O, there are other things that will not work without optimization at all. -Erwin _______________________________________________ uClinux-dev mailing list [email protected] http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by [email protected] To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
