Package: pinfo
Version: 0.6.9-5
Severity: important
Tags: patch
User: [email protected]
Usertags: origin-ubuntu ubuntu-patch oneiric

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

  https://bugs.launchpad.net/ubuntu/+source/pinfo/+bug/770803

This is because of incorrect link ordering during configuration: 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.

  * Fix link order to list libraries after the objects that require them.

diff -u pinfo-0.6.9/debian/patches/00list pinfo-0.6.9/debian/patches/00list
--- pinfo-0.6.9/debian/patches/00list
+++ pinfo-0.6.9/debian/patches/00list
@@ -3,0 +4 @@
+04_link_order.dpatch
only in patch2:
unchanged:
--- pinfo-0.6.9.orig/debian/patches/04_link_order.dpatch
+++ pinfo-0.6.9/debian/patches/04_link_order.dpatch
@@ -0,0 +1,57 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 04_link_order.dpatch by Colin Watson <[email protected]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix link order to list C objects before the libraries they require.
+
+@DPATCH@
+
+--- pinfo-0.6.9/macros/curses.m4       2006-03-09 19:44:38.000000000 +0000
++++ pinfo-0.6.9/macros/curses.m4       2011-09-12 13:36:35.000000000 +0100
+@@ -254,11 +254,11 @@
+ dnl
+ AC_DEFUN([AC_CHECK_CURSES_COMPILE], [
+ 
+-      dnl save CFLAGS and LDFLAGS and set new ones
++      dnl save CFLAGS and LIBS and set new ones
+       CFLAGS_OLD=$CFLAGS
+       CFLAGS="$CFLAGS $curses_includes"
+-      LDFLAGS_OLD=$LDFLAGS
+-      LDFLAGS="$LDFLAGS $curses_libs"
++      LIBS_OLD=$LIBS
++      LIBS="$LIBS $curses_libs"
+ 
+       dnl do the compile test 
+       AC_MSG_CHECKING([if curses is usable])
+@@ -288,7 +288,7 @@
+ 
+       dnl restore variables
+       CFLAGS=$CFLAGS_OLD
+-      LDFLAGS=$LDFLAGS_OLD
++      LIBS=$LIBS_OLD
+ 
+ ])
+ 
+--- pinfo-0.6.9/configure      2006-03-16 16:27:26.000000000 +0000
++++ pinfo-0.6.9/configure      2011-09-12 13:37:12.000000000 +0100
+@@ -10139,8 +10139,8 @@
+ 
+               CFLAGS_OLD=$CFLAGS
+       CFLAGS="$CFLAGS $curses_includes"
+-      LDFLAGS_OLD=$LDFLAGS
+-      LDFLAGS="$LDFLAGS $curses_libs"
++      LIBS_OLD=$LIBS
++      LIBS="$LIBS $curses_libs"
+ 
+               echo "$as_me:$LINENO: checking if curses is usable" >&5
+ echo $ECHO_N "checking if curses is usable... $ECHO_C" >&6
+@@ -10211,7 +10211,7 @@
+       conftest$ac_exeext conftest.$ac_ext
+ 
+               CFLAGS=$CFLAGS_OLD
+-      LDFLAGS=$LDFLAGS_OLD
++      LIBS=$LIBS_OLD
+ 
+ 
+       else
+

Thanks,

-- 
Colin Watson                                       [[email protected]]



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

Reply via email to