Package: packeth
Version: 1.6.5-1
Severity: important
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch oneiric

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

  https://bugs.launchpad.net/ubuntu/+source/packeth/+bug/771125

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.

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

diff -Nru packeth-1.6.5/debian/patches/03-link_order.patch 
packeth-1.6.5/debian/patches/03-link_order.patch
--- packeth-1.6.5/debian/patches/03-link_order.patch    1970-01-01 
01:00:00.000000000 +0100
+++ packeth-1.6.5/debian/patches/03-link_order.patch    2011-09-13 
11:45:40.000000000 +0100
@@ -0,0 +1,40 @@
+Description: List libraries after the objects that require them
+Author: Colin Watson <cjwat...@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/771125
+Forwarded: no
+Last-Update: 2011-09-13
+
+Index: b/Makefile.am
+===================================================================
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -29,7 +29,7 @@
+ DEFS= \
+   -DPKGDATADIR=\"$(pkgdatadir)/\"
+ 
+-AM_LDFLAGS=$(DEPS_LIBS)
++packETH_LDADD=$(DEPS_LIBS)
+ 
+ AM_CPPFLAGS = \
+   -g \
+Index: b/Makefile.in
+===================================================================
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -55,7 +55,6 @@
+       src/function.$(OBJEXT) src/function_send.$(OBJEXT) \
+       src/loadpacket.$(OBJEXT) src/savepacket.$(OBJEXT)
+ packETH_OBJECTS = $(am_packETH_OBJECTS)
+-packETH_LDADD = $(LDADD)
+ DEFAULT_INCLUDES = -I.@am__isrc@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+@@ -203,7 +202,7 @@
+ 
+ pixmapdir = $(pkgdatadir)/pixmaps
+ pixmap_DATA = $(pixmaps)
+-AM_LDFLAGS = $(DEPS_LIBS)
++packETH_LDADD = $(DEPS_LIBS)
+ AM_CPPFLAGS = \
+   -g \
+   -O2 \
diff -Nru packeth-1.6.5/debian/patches/series 
packeth-1.6.5/debian/patches/series
--- packeth-1.6.5/debian/patches/series 2010-03-04 20:32:04.000000000 +0000
+++ packeth-1.6.5/debian/patches/series 2011-09-13 11:36:33.000000000 +0100
@@ -1,2 +1,3 @@
 01-fix_warnings.patch
 02-fix_typo.patch
+03-link_order.patch

Thanks,

-- 
Colin Watson                                       [cjwat...@ubuntu.com]



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to