I have a few different machines with various versions of gentoo linux. I have noticed on my machines with: glibc-2.3.2-r9 kernel=development-sources-2.6.3 gcc-3.3.2 usermode linux cannot link. This is true for: usermode-sources-2.6.3-r1 usermode-sources-2.4.24-r1 however, the link errors are slightly different between kernel versions. Here is the error for the 2.4.24 uml kernel: gcc -Wl,-T,arch/um/link.ld -static -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc \ -o linux arch/um/main.o vmlinux.o -L/usr/lib -lutil vmlinux.o(.text+0x134e30): In function `sscanf': /usr/src/uml/linux-2.4.24/lib/vsprintf.c:718: multiple definition of `sscanf' arch/um/kernel/tt/unmap_fin.o(.text+0x31b54): first defined here vmlinux.o(.text+0x133e20): In function `strpbrk': /usr/src/uml/linux-2.4.24/lib/string.c:280: multiple definition of `strpbrk' arch/um/kernel/tt/unmap_fin.o(.text+0x33e60): first defined here /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/../../../../i686-pc-linux-gnu/bin/ld: Warning: size of symbol `strpbrk' changed from 179 in arch/um/kernel/tt/unmap_fin.o to 82 in vmlinux.o /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/../../../../i686-pc-linux-gnu/bin/ld: BFD 2.14.90.0.7 20031029 assertion fail elf.c:3460 collect2: ld returned 1 exit status make: *** [linux] Error 1 My other machines with: glibc-2.3.2-r5 (or 9) 2.6.3 kernel gcc-3.2.3 can all link the uml kernel just fine. Steps to reproduce: emerge =sys-libs/glibc-2.3.2-r9 emerge =sys-devel/gcc-3.3.2-r5 emerge =sys-kernel/usermode-sources-2.4.24-r1 cd /usr/src/uml/linux make menuconfig ARCH=um make linux ARCH=um
I was able to get 2.4.24-r1 to compile by disabling General Setup->Tracing Thread Support General Setup->Statically linked binary when CONFIG_MODE_TT is disabled NOTE Tracing thread is the default and you can't use SKAS unless you patch the host kernel.
Can you try upgrading binutils and see if that helps the issue?
Upgrading binutils has no effect. I also tried the latest ~x86 version.
I can now get the 2.6.4 kernel to compile with the latest uml patch. I still hava to disable TT mode or I get the same type of linking errors. (Time for a new ebuild there because the 2.6.3 uml had a pretty serious stability issue) This works for me because I've patched the host kernel for SKAS. I think usermode-sources isn't very usable with gcc >=3.3.2 for most users.
This issue is resolved, just not closed. Let's fix that.
The issue is NOT resolved. You can't compile the kernel if TT mode is enabled. Unfortunately, that is the mode that most people need to run in. To run in SKAS mode you have to patch the host kernel separately and that is not very clear for most users, nor is there an ebuild for it.
Please mark this issue as duplicated of 49277. This issue is neither gcc nor binutils related. It appears only with NPTL glibc. However, it showed up more recently (in bug #49277) and we UML developers fixed that. The fix is in http://marc.theaimsgroup.com/?l=linux-kernel&m=110011391701565&w=2 You can also find it (updated against the different tree) in the 2.6.9-bb4 patchset, which is: http://www.user-mode-linux.org/~blaisorblade Inside the patchset, the specific patch for this issue is: uml-use-sys-getpid-bypassing-glibc.patch However, please note the patch is not perfect against previous UML releases - there is a remaining getpid() -> os_getpid() conversion to do in older releases, but the affected code has been dropped in -bb4.
Correction: th it can also appear without NPTL glibc, and the patch is only for when building in SKAS mode against