[Pkg-tcltk-devel] Bug#639284: tkpng: ftbs with ld --as-needed

Julian Taylor jtaylor.debian at googlemail.com
Thu Aug 25 16:00:39 UTC 2011


Package: tkpng
Version: 0.9-1
Severity: wishlist
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu oneiric ubuntu-patch

the package tkpng fails to build when using the linker flag --as-needed
This is caused by the library -lm added to LDFLAGS in debian rules.
This causes the library to be placed before the objects needing its symbols.
This causes undefined references when built with ld --as-needed.
See the log in the ubuntu bug:
https://bugs.launchpad.net/ubuntu/+source/tkpng/+bug/832926

This aptch fixes the issue by moving -lm into LIBS:

=== modified file 'debian/rules'
--- debian/rules	2008-11-12 14:06:43 +0000
+++ debian/rules	2011-08-25 15:57:34 +0000
@@ -32,7 +32,8 @@
 	--with-tclinclude=/usr/include/tcl8.5/ \
 	--with-tkinclude=/usr/include/tcl8.5/ \
 	CFLAGS="$(CFLAGS)" \
-	LDFLAGS="-lm -Wl,-z,defs -Wl,--no-undefined -Wl,--as-needed"
+	LDFLAGS="-Wl,-z,defs -Wl,--no-undefined -Wl,--as-needed" \
+	LIBS="-lm"
 	touch $@

 build: build-stamp


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-tcltk-devel/attachments/20110825/e1729dfe/attachment.pgp>


More information about the Pkg-tcltk-devel mailing list