Compiling media-libs/dumb-0.9.3-r1 with LDFLAGS=-Wl,--as-needed" fails. Removing it allows for successful compilation. It should be filtered in the ebuild or fixed upstream. Log at relevant moment with --as-needed: gcc examples/dumbout.o lib/unix/libdumb.so -o examples/dumbout -Wl,-O1 -Wl,-s -Wl,--as-needed -lm gcc examples/dumb2wav.o lib/unix/libdumb.so -o examples/dumb2wav -Wl,-O1 -Wl,-s -Wl,--as-needed -lm lib/unix/libdumb.so: undefined reference to `log' lib/unix/libdumb.so: undefined reference to `exp' lib/unix/libdumb.so: undefined reference to `pow' collect2: ld returned 1 exit status make[1]: *** [examples/dumbout] Error 1 make[1]: *** Waiting for unfinished jobs.... lib/unix/libdumb.so: undefined reference to `log' lib/unix/libdumb.so: undefined reference to `exp' lib/unix/libdumb.so: undefined reference to `pow' collect2: ld returned 1 exit status make[1]: *** [examples/dumb2wav] Error 1 make: *** [all] Error 2
The fix seems rather obvious - libdumb should link with libm.
I just successfully emerged media-libs/dumb with: LDFLAGS="-Wl,--as-needed" emerge -1B dumb So i can't really reproduce the problem at all. 2 other devs just successfully built it on their own machine too. What about changing this 2 lines in files/dumb-0.9.2-PIC.patch? + $(CC) -shared -o $@ -Wl,-shared,-soname,$(shell basename $@) $^ to + $(CC) -shared -o $@ -Wl,-shared,-soname,$(shell basename $@) -lm $^ Does this fix it for you? However i'm still not being able to reproduce it and at least 2 other devs also couldn't reproduce it.
Yes, changing those 2 lines does indeed fix the bug for me.
Should I have reopened this after delivering info? Please feel free to close again if not.
Thanks for your feedback. The problem is not that i lost track of this bug, it's more that i can't reproduce the problem and 2 other devs also couldn't reproduce it.
+ 08 May 2009; Samuli Suominen <ssuominen@gentoo.org> + files/dumb-0.9.2-PIC.patch: + Insert -lm to linking for -Wl,--as-needed wrt #245526 thanks guys