Bug#627428: gmetadom: fails to build with 'ld --as-needed'
Package: gmetadom
Version: 0.2.6-5
Severity: normal
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch oneiric
As reported in
https://bugs.launchpad.net/ubuntu/+source/gmetadom/+bug/771037, gmetadom
fails to build with 'ld --as-needed'. See
http://wiki.debian.org/ToolChain/DSOLinking#Only_link_with_needed_libraries
for details. This can be fixed by adjusting link order so that
libraries come after the objects/libraries that use their symbols, as in
the following patch.
* Rearrange link order to work with 'ld --as-needed'.
diff -u gmetadom-0.2.6/debian/patches/00list gmetadom-0.2.6/debian/patches/00list
--- gmetadom-0.2.6/debian/patches/00list
+++ gmetadom-0.2.6/debian/patches/00list
@@ -1,0 +2 @@
+ld-as-needed.dpatch
only in patch2:
unchanged:
--- gmetadom-0.2.6.orig/debian/patches/ld-as-needed.dpatch
+++ gmetadom-0.2.6/debian/patches/ld-as-needed.dpatch
@@ -0,0 +1,35 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## ld-as-needed.dpatch by Colin Watson <cjwatson@ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: rearrange link order to work with 'ld --as-needed'
+
+@DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' gmetadom~/src/gdome_cpp_smart/test/Makefile.am gmetadom/src/gdome_cpp_smart/test/Makefile.am
+--- gmetadom~/src/gdome_cpp_smart/test/Makefile.am 2007-05-08 16:26:18.000000000 +0100
++++ gmetadom/src/gdome_cpp_smart/test/Makefile.am 2011-05-20 15:20:07.000000000 +0100
+@@ -6,9 +6,9 @@
+ deep_SOURCES = deep.cc
+
+ LDADDS = \
+- $(GDOME_LIBS) \
+ $(top_builddir)/src/gdome_cpp_smart/.libs/libgmetadom_gdome_cpp_smart.a \
+ $(top_builddir)/src/gdome_cpp_smart/libgmetadom_gdome_cpp_smart.la \
++ $(GDOME_LIBS) \
+ -lstdc++
+
+ test_LDADD = $(LDADDS)
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' gmetadom~/src/gdome_cpp_smart/test/Makefile.in gmetadom/src/gdome_cpp_smart/test/Makefile.in
+--- gmetadom~/src/gdome_cpp_smart/test/Makefile.in 2007-10-15 10:42:44.000000000 +0100
++++ gmetadom/src/gdome_cpp_smart/test/Makefile.in 2011-05-20 15:20:13.000000000 +0100
+@@ -217,9 +217,9 @@
+ basic_SOURCES = basic.cc
+ deep_SOURCES = deep.cc
+ LDADDS = \
+- $(GDOME_LIBS) \
+ $(top_builddir)/src/gdome_cpp_smart/.libs/libgmetadom_gdome_cpp_smart.a \
+ $(top_builddir)/src/gdome_cpp_smart/libgmetadom_gdome_cpp_smart.la \
++ $(GDOME_LIBS) \
+ -lstdc++
+
+ test_LDADD = $(LDADDS)
Thanks,
--
Colin Watson [cjwatson@ubuntu.com]
Reply to: