building fiasco on alpine linux

Michael Schnupp Michael_Schnupp at genua.de
Thu Jun 23 03:00:49 CEST 2016


On Wed, Jun 22, 2016 at 12:18:56AM +0200, Adam Lackorzynski wrote:
> > I tried to build fiasco on alpine linux.
> > This will fail with the following line:
> > 
> >   auto/jdb_ktrace.cc:1:0: error: code model kernel does not support PIC mode
> 
> Just this file or more/all files?

Not sure. The build stopped after the first error and I was not able to reconfigure for ignoring that file.

> > Their gcc enables PIC per default for security reasons. Since fiasco seems to need PIC disabled I have to tell the build system either to add -fno-PIC explictly, or to -D__KERNEL__ in any way.
> > (I already tried DEFINES += -D__KERNEL__ or CFLAGS := -fno-PIC in Makeconf without success.)
> > 
> > What is the correct way to add such an option to the fiasco build system?
> > Would it hurt to add -D__KERNEL__ per default on future releases? (After all it *is* a kernel.)
> 
> I'd add this to src/Makeconf:
> SHARED_FLAGS            += -fno-pic
> 
> Does this fix it?

Not completely. Now compiling seem to work fine, but linking will run into problems:

  ==> 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
  kip_init-ia32.o: In function `Kip_init::init()':
  kip_init-ia32.cc:(.initcall.text+0x33): 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+0xd8): 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+0xe8): relocation truncated to fit: R_X86_64_32 against symbol `_end' defined in .bss section in fiasco.image
  kip_init-ia32.cc:(.initcall.text+0x27d): 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+0x30b): relocation truncated to fit: R_X86_64_32 against symbol `_end' defined in .bss section in fiasco.image
  kip_init-ia32.cc:(.initcall.text+0x33d): relocation truncated to fit: R_X86_64_32 against symbol `_end' defined in .bss section in fiasco.image
  kip_init-ia32.cc:(.initcall.text+0x37e): relocation truncated to fit: R_X86_64_32 against symbol `_kernel_image_start' defined in .kip section in fiasco.image
  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
  .../kernel/fiasco/src/boot/amd64/Makerules.BOOT.amd64:29: recipe for target 'fiasco.image' failed

The above output is from building with 'make SHARED_FLAGS=-D__KERNEL__'.
There is a bit more noise with -fno-pic or -fno-PIC, but it is the same kind of problem.

Any idea what exactly is going on here?



More information about the l4-hackers mailing list