Summary: | glibc? built with gcc-4.6? issues with: /lib/libdl.so.2: undefined reference to `__environ@GLIBC_2.0' (when stripping .note.ABI-tag) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Piotr Szymaniak <bugzie> |
Component: | [OLD] Core system | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED INVALID | ||
Severity: | major | CC: | ansla80 |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Build.log.bz2
sdl-mixer-Build.log irssi-Build.log irssi-config.log vim-Build.log vim-config.log output.log readelf output |
Description
Piotr Szymaniak
2012-01-18 21:49:22 UTC
On other ~x86 machine and newer glibc the mentioned command looks like this: rekowered ~ # readelf -a /lib/libdl-2.14.1.so | grep environ 00003fcc 00000206 R_386_GLOB_DAT 00000000 __environ 2: 00000000 0 OBJECT GLOBAL DEFAULT UND __environ@GLIBC_2.0 (7) 15: 00000000 0 OBJECT WEAK DEFAULT UND _environ@GLIBC_2.0 (7) 21: 00000000 0 OBJECT WEAK DEFAULT UND environ@GLIBC_2.0 (7) and yeah, it works fine… would be nice to give me some more ideas about this issue. the symbol is supposed to be defined in libc.so.6: $ readelf -s /lib32/libc.so.6 | grep environ 299: 0019ae00 4 OBJECT WEAK DEFAULT 30 _environ@@GLIBC_2.0 1018: 0019ae00 4 OBJECT WEAK DEFAULT 30 environ@@GLIBC_2.0 1363: 0019ae00 4 OBJECT GLOBAL DEFAULT 30 __environ@@GLIBC_2.0 is it not being defined that way on your system ? please post the full glibc build log as an attachment (compress it if need be). Created attachment 302231 [details]
Build.log.bz2
Build.log
output of above command on glibc with issues:
maszyn ~ (: readelf -s /lib/libc.so.6 | grep environ
298: 00178d80 4 OBJECT WEAK DEFAULT 31 _environ@@GLIBC_2.0
1012: 00178d80 4 OBJECT WEAK DEFAULT 31 environ@@GLIBC_2.0
1351: 00178d80 4 OBJECT GLOBAL DEFAULT 31 __environ@@GLIBC_2.0
also post the full build log of the sdl-mixer package as an attachment Created attachment 308489 [details]
sdl-mixer-Build.log
Created attachment 308493 [details]
irssi-Build.log
Got also other packages that fail _after_ glibc was merged:
maszyn ~ # emerge -pqv ncurses glib
[ebuild R ] sys-libs/ncurses-5.9-r2 USE="cxx gpm unicode -ada -debug -doc -minimal -profile -static-libs -trace"
[ebuild R ] dev-libs/glib-2.30.3 USE="fam static-libs -debug -doc (-selinux) -systemtap -test -utils -xattr"
(ncurses as a reference to vim-Build.log)
Created attachment 308495 [details]
irssi-config.log
Created attachment 308497 [details]
vim-Build.log
Created attachment 308499 [details]
vim-config.log
(In reply to comment #5) ok, now go into the sdl-mixer build dir: cd /tmp/portage/media-libs/sdl-mixer-1.2.12/work/SDL_mixer-1.2.12 and run: i686-pc-linux-gnu-gcc -o build/.libs/playmus build/.libs/playmus.o -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL build/.libs/libSDL_mixer.so -lSDL -lpthread -lvorbisfile -lvorbis -logg -lFLAC -lmad -lm if that still fails, then run: i686-pc-linux-gnu-gcc -o build/.libs/playmus build/.libs/playmus.o -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL build/.libs/libSDL_mixer.so -lSDL -lpthread -lvorbisfile -lvorbis -logg -lFLAC -lmad -lm -v -Wl,--verbose and post the full output of that last command as an attachment Created attachment 308561 [details] output.log (In reply to comment #10) > (In reply to comment #5) > if that still fails, then run: It failed. what does `readelf -d /lib/libdl.so.2 /usr/lib/libglib-2.0.so` show ? Created attachment 308615 [details] readelf output Output of readelf from comment #12. *bump* I would love to solve this issue one way or another. If not here i will try with glibc package from some other machine. Just noticing that I tried glibc-2.15-r1 and same thing happend. I'm not sure if this is glibc issue anymore. Tried to install glibc from binhost [1] and after glibc re-emerge it's exacly the same (vim won't find terminal lib, irssi won't find glib and sdl-mixer has the undefined reference). As suggested by one of the devs (Amadeusz Żołnowski / aidecoe [2]) I went through emerge -e @system and emerge -e @world (both with --exclude=glibc) and nothing changes. [1] http://tinderbox.dev.gentoo.org/default-linux/x86/ [2] he hit the same "undefined reference" bug, used his system backup, but after few days/weeks and another try everything went fine for his glibc (or wherever the bug is) I can see this is not included in emerge --info. Also, don't even know if this is still used, but in my /etc/make.conf (i think on all my Gentoo boxes) i have a line: PORTAGE_STRIP_FLAGS="--strip-unneeded -R .comment -R .note -R .note.ABI-tag" Yesterday I had some time to do random tests with glibc (removed C{,XX}FLAGS and added debug options, added USE="debug", made MAKEOPTS="-j1", #PORTAGE_STRIP_FLAGS) and it seems that everything went fine. Then I reemerged sdl-mixer, irssi and vim without any issues. Then I added/removed some of the flags/optimisations above and it looks like the problem is in the STRIP line. Here's the current output of "readelf -s /lib/libc.so.6 | grep environ": 298: 00178d80 4 OBJECT WEAK DEFAULT 31 _environ@@GLIBC_2.0 1012: 00178d80 4 OBJECT WEAK DEFAULT 31 environ@@GLIBC_2.0 1351: 00178d80 4 OBJECT GLOBAL DEFAULT 31 __environ@@GLIBC_2.0 I will keep sys-libs/glibc-2.13-r4 for a few days and check if everything works without some random issues (maybe even -e @world, who knows ;) and then update to ~arch glibc. pretty sure .note.ABI-tag is not something you can safely throw away. it contains bits used by the link-time linker (`ld`) and the runtime linker (`ldso`). so if removing that flag is causing you problems, then don't do that. the other flags you specified we already use as the default strip flags. |