Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 245526 - media-libs/dumb needs --as-needed fix
Summary: media-libs/dumb needs --as-needed fix
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: Christian Birchinger (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-04 14:50 UTC by haarp
Modified: 2009-05-08 16:30 UTC (History)
1 user (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 haarp 2008-11-04 14:50:10 UTC
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
Comment 1 Rafał Mużyło 2008-11-04 15:49:40 UTC
The fix seems rather obvious - libdumb should link with libm.
Comment 2 Christian Birchinger (RETIRED) gentoo-dev 2008-11-05 14:26:33 UTC
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.
Comment 3 haarp 2008-11-05 19:20:45 UTC
Yes, changing those 2 lines does indeed fix the bug for me.
Comment 4 haarp 2008-11-11 22:52:52 UTC
Should I have reopened this after delivering info? Please feel free to close again if not.
Comment 5 Christian Birchinger (RETIRED) gentoo-dev 2008-11-20 23:18:53 UTC
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.
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2009-05-08 16:30:43 UTC
+  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