Hello,
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.
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.
Both of the above issues are present in repository versions 74, 75 and 76 at the very least. Certainly, the first issue is not likely to be absent in earlier versions.
Paul
P.S. I have also been experiencing a build problem with L4Re on i386, but this will be described in another message.
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
On Tuesday 30. January 2018 00.32.30 Adam Lackorzynski wrote:
On Mon Jan 29, 2018 at 22:36:34 +0100, Paul Boddie wrote:
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.
Again, this doesn't seem to be a problem on jessie/oldstable and stretch/stable, but only on sid/unstable.
So I think that the Debian GCC versions for the former two (4.9.2-10, 6.3.0-18) are fine, whereas 6.4.0-12 (and probably earlier 6.4.0 versions) are not.
Or if this is a linker issue, then the binutils versions for the former two (2.25, 2.28) are fine, whereas 2.30 is not.
It may be prudent to not change anything definitively if this is just a transient toolchain bug, although if there are no disadvantages then maybe just removing memcmp.c saves you from further bug reports. :-)
Paul
l4-hackers@os.inf.tu-dresden.de