On Fri, Jun 24, 2016 at 12:05:43AM +0200, Adam Lackorzynski wrote:
I gave this a try with Alpine 3.4 and just the -fno-pic addition made it compile for me. However, the error message while compiling was different. Thus: Which version do you use?
I'm currently using a fresh install of the current Alpine 3.4. Everything is amd64.
$ uname -a Linux alpine 4.4.11-0-grsec #1-Alpine SMP Fri May 20 08:35:18 GMT 2016 x86_64 Linux $ gcc --version gcc (Alpine 5.3.0) 5.3.0
I use am minimally configured fiasco from the current public snapshot.
tar xf l4re-snapshot-2016060908.tar.bz2 make -C l4re-snapshot-2016060908/src/kernel/fiasco/ B=$PWD/fiasco echo "CONFIG_AMD64=y" >fiasco/globalconfig.out make -C fiasco olddefconfig make -C fiasco V=0 SHARED_FLAGS=-fno-pic
This results in:
==> Linking fiasco.image boot_img.o: In function `bootstrap_bootstrap': (.bootstrap.text+0x98): relocation truncated to fit: R_X86_64_32 against symbol `_start' defined in .text section in crt0.o boot_img.o: In function `bootstrap_bootstrap': (.bootstrap.text+0x39b): undefined reference to `__stack_chk_fail' boot_img.o: In function `bootstrap__Z14base_cpu_setupv': (.bootstrap.text+0x5b0): undefined reference to `__stack_chk_fail' boot_img.o: In function `bootstrap_printf': (.bootstrap.text+0xb09): undefined reference to `__stack_chk_fail' boot_img.o: In function `bootstrap_vprintf': (.bootstrap.text+0xb7e): undefined reference to `__stack_chk_fail' boot_img.o: In function `bootstrap___v_printf': (.bootstrap.text+0x141a): undefined reference to `__stack_chk_fail' kip_init-ia32.o: In function `Kip_init::init()': kip_init-ia32.cc:(.initcall.text+0x25): relocation truncated to fit: R_X86_64_32 against symbol `my_kernel_info_page' defined in .kernel_info_page section in kip_init-ia32.o kip_init-ia32.cc:(.initcall.text+0xe8): relocation truncated to fit: R_X86_64_32 against symbol `_kernel_image_start' defined in .kip section in fiasco.image kip_init-ia32.cc:(.initcall.text+0xf8): relocation truncated to fit: R_X86_64_32 against symbol `_end' defined in .bss section in fiasco.image kip_init-ia32.cc:(.initcall.text+0x2a5): relocation truncated to fit: R_X86_64_32 against symbol `_kernel_image_start' defined in .kip section in fiasco.image kip_init-ia32.cc:(.initcall.text+0x32b): relocation truncated to fit: R_X86_64_32 against symbol `_end' defined in .bss section in fiasco.image kip_init-ia32.cc:(.initcall.text+0x36c): relocation truncated to fit: R_X86_64_32 against symbol `_kernel_image_start' defined in .kip section in fiasco.image kip_init-ia32.cc:(.initcall.text+0x3a3): relocation truncated to fit: R_X86_64_32 against symbol `_end' defined in .bss section in fiasco.image kip_init-ia32.o:kip_init-ia32.cc:(.initcall.text+0x3ce): more undefined references to `__stack_chk_fail' follow libabi.a(kip.o): In function `Kip::add_mem_region(Mem_desc const&)': kip.cc:(.text+0x61): relocation truncated to fit: R_X86_64_32 against `.rodata.str1.8' thread-ia32.o: In function `Thread::handle_int3(Trap_state*)': thread-ia32.cc:(.text+0x55): relocation truncated to fit: R_X86_64_32 against `.rodata.str1.1' thread-ia32.cc:(.text+0x14e): additional relocation overflows omitted from the output .../l4re-snapshot-2016060908/src/kernel/fiasco/src/boot/amd64/Makerules.BOOT.amd64:29: recipe for target 'fiasco.image' failed
If I replace '-fno-pic' with '-D__KERNEL__' it will no longer complain about the undefiend reference, but still complain about the trucated relocation.
It is no big problem if it does not compile on this kind of system. It only felt like there might be an easy fix.