HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Kernel Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=6)
-   -   kernel compilation error on ubuntu edgy (http://www.howtoforge.com/forums/showthread.php?t=10522)

cio 11th February 2007 23:27

kernel compilation error on ubuntu edgy
 
I have followed the steps on:

http://www.howtoforge.com/kernel_compilation_ubuntu

to recompile the kernel on my ubuntu edgy. Unfortunately in the during the compilation process I get this error:


LD init/built-in.o
LD .tmp_vmlinux1
init/built-in.o: In function `try_name':
do_mounts.c: (.text+0x4a4): undefined reference to `__stack_chk_fail'
init/built-in.o: In function `name_to_dev_t':
(.text+0x789): undefined reference to `__stack_chk_fail'
init/built-in.o: In function `change_floppy':
(.init.text+0x9a1): undefined reference to `__stack_chk_fail'
init/built-in.o: In function `mount_block_root':
(.init.text+0xc03): undefined reference to `__stack_chk_fail'
init/built-in.o: In function `do_header':
initramfs.c: (.init.text+0x4294): undefined reference to `__stack_chk_fail'
arch/i386/kernel/built-in.o: (.text+0x4701): more undefined references to `__stack_chk_fail' follow
make[1]: *** [.tmp_vmlinux1] Error 1
make[1]: Leaving directory 'usr/src/linux2.6.16'
make: *** [debian/stamp-build-kernel] Error 2

I have tried to compile different kernel sources( 2.6.16, 2.6.17-10) while running different version of kernels( 2.6.17.10-386, 2.6.17.10-generic, 2.6.17.11-generic). I even tried it on different computers just to see if there is hardware issue or .config problem. ( I always copied .config from the /boot/config-2.6.xx). But I always got the exact same error.
Any help will be very appreciated.(I have to compile this kernel by tuesday as a homework :D)

cio 12th February 2007 00:27

I just found it at the 10th page after googling :D

I am posting the solution in case some one has the same problem:

in your source folder's root edit the Makefile like this:

in the original makefile cflags assignment was like this:
CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common

add this option:
CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common -fno-stack-protector

the other may change from different kernel versions, the only thing is to add -fno-stack-protector.

and also add this at the end of assignments to cflags here:

initially:

CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)

CFLAGS += $(call cc-option,-Wno-pointer-sign,)

after modifying with this line:

CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)

CFLAGS += $(call cc-option,-Wno-pointer-sign,)

CFLAGS += $(call cc-option, -fno-stack-protector-all \
-fno-stack-protector)

this forum was a lucky charm for me :D I hope I can help!

catblade0 7th March 2008 21:06

Thanks
 
It actually helped me, using the lttng toolkit. Thank you!

shail.sapna 1st September 2010 15:10

Thanks a lottttt
 
yuppp it helped me too...it was really awesome :)


All times are GMT +2. The time now is 10:04.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.