Package: digitools
Version: 1.3-1
Severity: important
Tags: patch
User: [email protected]
Usertags: origin-ubuntu ubuntu-patch oneiric

digitools fails to build with a linker that defaults to --as-needed, as
shown in this Ubuntu bug report:

  https://bugs.launchpad.net/ubuntu/+source/digitools/+bug/831389

This is because of incorrect link ordering: it puts libraries before the
objects that use them rather than after.  See:

  http://wiki.debian.org/ToolChain/DSOLinking#Only_link_with_needed_libraries

The following patch fixes this.

  * Put libraries in LDLIBS, not LDFLAGS.

diff -u digitools-1.03/debian/patches/00list 
digitools-1.03/debian/patches/00list
--- digitools-1.03/debian/patches/00list
+++ digitools-1.03/debian/patches/00list
@@ -1,0 +2 @@
+02_link_order.dpatch
only in patch2:
unchanged:
--- digitools-1.03.orig/debian/patches/02_link_order.dpatch
+++ digitools-1.03/debian/patches/02_link_order.dpatch
@@ -0,0 +1,20 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 02_link_order.dpatch by Colin Watson <[email protected]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Libraries belong in LDLIBS rather than LDFLAGS, otherwise the link
+## DP: order will be wrong.
+
+@DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' 
'--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' 
digitools-1.03~/Makefile digitools-1.03/Makefile
+--- digitools-1.03~/Makefile   2011-09-16 16:52:05.000000000 +0100
++++ digitools-1.03/Makefile    2011-09-16 16:52:25.000000000 +0100
+@@ -3,7 +3,7 @@
+ SBINDIR = $(PREFIX)/sbin
+ 
+ # Users should not need to edit anything below this line.
+-LDFLAGS = -lasound
++LDLIBS = -lasound
+ CFLAGS = -Wall -Os
+ 
+ LN = ln

Thanks,

-- 
Colin Watson                                       [[email protected]]



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to