Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 43616 - gcc 3.3.2 cannot link usermode sources (2.4.24-r1 & 2.6.3-r1)
Summary: gcc 3.3.2 cannot link usermode sources (2.4.24-r1 & 2.6.3-r1)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: x86-kernel@gentoo.org (DEPRECATED)
URL:
Whiteboard:
Keywords:
Depends on: 4927
Blocks:
  Show dependency tree
 
Reported: 2004-03-03 08:54 UTC by Dennis Muhlestein
Modified: 2005-01-11 17:23 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Muhlestein 2004-03-03 08:54:25 UTC
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
Comment 1 Dennis Muhlestein 2004-03-03 11:56:23 UTC
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.
Comment 2 Tim Yamin (RETIRED) gentoo-dev 2004-03-13 05:50:32 UTC
Can you try upgrading binutils and see if that helps the issue?
Comment 3 Dennis Muhlestein 2004-03-17 15:49:55 UTC
Upgrading binutils has no effect.  I also tried the latest ~x86 version.
Comment 4 Dennis Muhlestein 2004-03-18 09:47:43 UTC
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.
Comment 5 Jason Cox (RETIRED) gentoo-dev 2004-04-13 21:51:00 UTC
This issue is resolved, just not closed. Let's fix that.
Comment 6 Dennis Muhlestein 2004-04-14 16:02:57 UTC
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.
Comment 7 BlaisorBlade 2004-12-07 07:59:07 UTC
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.
Comment 8 BlaisorBlade 2004-12-07 08:01:25 UTC
Correction: th
it can also appear without NPTL glibc, and the patch is only for when building in SKAS mode against