Package: radare2
Version: 0.9-2
Severity: wishlist
User: [email protected]
Usertags: ld-as-needed
Tags: patch

radare2 fails to build with ld --as-needed.
This is caused by libr_core not being linked against libmagic of which
it uses symbols directly.
See the buildlog in ubuntu:
https://launchpadlibrarian.net/88223608/buildlog_ubuntu-precise-i386.radare2_0.9-2_FAILEDTOBUILD.txt.gz

attached patch fixes this issue.

Note that the use of LDFLAGS to link libraries is wrong in buildsystems
like autotools, LIBS or LDADD is used there. Using LDFLAGS results in
wrong commandline ordering.
The variable is used correctly in this package but I would still
recommend renaming the variable.
Description: link with needed libmagic
 required when building with ld --as-needed
Author: Julian Taylor <[email protected]>

Index: radare2-0.9/libr/core/Makefile
===================================================================
--- radare2-0.9.orig/libr/core/Makefile	2011-12-31 18:54:20.000000000 +0000
+++ radare2-0.9/libr/core/Makefile	2011-12-31 18:57:53.467286854 +0000
@@ -9,7 +9,7 @@
 
 CFLAGS+=-DLIBDIR=\"${LIBDIR}\"
 CFLAGS+=-DPREFIX=\"${PREFIX}\"
-LDFLAGS+=${DL_LIBS}
+LDFLAGS+=${DL_LIBS} -lmagic
 
 ifeq ($(shell uname),OpenBSD)
 LDFLAGS+=-lpthread

Reply via email to