kernel compilation error on ubuntu edgy

Discussion in 'Kernel Questions' started by cio, Feb 11, 2007.

  1. cio

    cio New Member

    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)
     
    Last edited: Feb 11, 2007
  2. cio

    cio New Member

    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!
     
  3. catblade0

    catblade0 New Member

    Thanks

    It actually helped me, using the lttng toolkit. Thank you!
     
  4. shail.sapna

    shail.sapna New Member

    Thanks a lottttt

    yuppp it helped me too...it was really awesome :)
     

Share This Page