On Mon Jan 29, 2018 at 22:36:34 +0100, Paul Boddie wrote:
More awkward news from Debian on i386! I was looking to build the "Linux Usermode Platform" variant of Fiasco-OC on i386 (well, Pentium 4) and encountered a couple of issues.
Firstly, "struct ucontext" is mentioned in src/kern/ux/usermode.cpp but has been deprecated in favour of "ucontext_t". There are some User Mode Linux reports about this:
https://lkml.org/lkml/2017/11/15/159 https://lkml.org/lkml/2018/1/25/522
A search-and-replace involving the two terms fixes the compilation error that otherwise occurs.
Thanks.
Secondly, linking of the kernel fails due to symbol conflicts between the minilibc functionality and glibc:
/usr/lib/gcc/i686-linux-gnu/6/../../../i386-linux-gnu/libc.a(memcmp.o): In function `memcmp': (.text+0x0): multiple definition of `memcmp' libc.a(memcmp.o):/home/paulb/L4/UX-75/src/kernel/fiasco/src/lib/minilibc/memcmp.c:7: first defined here collect2: error: ld returned 1 exit status /home/paulb/L4/UX-75/src/kernel/fiasco/src/kern/ux/Makerules.KERNEL:35: recipe for target 'fiasco.debug' failed
So, not knowing how best to deal with this, I relied on the --allow-multiple- definition linker option:
https://gcc.gnu.org/ml/gcc-help/2009-09/msg00108.html
I doubt that this is the right way to deal with it. Maybe GCC 6.4 (Debian 6.4.0-12) introduced some behaviour that is not compatible with the way this linking is being done.
With older binutils it works, with the most recent ones not. Anyway, removing memcmp.c from src/Modules.ux seems to fix it, and it works on both older and recent environments.
Thanks, Adam