[Debian-med-packaging] Bug#895344: psortb: build compatibility with -Wl, --as-needed

Steve Langasek steve.langasek at canonical.com
Tue Apr 10 07:19:01 BST 2018


Package: psortb
Version: 3.0.5+dfsg-1
Severity: minor
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu bionic ubuntu-patch

Dear maintainers,

The psortb package has been failing to build in Ubuntu because it supplies
options to the linker in the wrong order:

[...]
x86_64-linux-gnu-gcc -g -O2 -fdebug-prefix-map=/<<BUILDDIR>>/psortb-3.0.5+dfsg=.
 -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functi
ons -Wl,-z,relro -Wl,-z,now  -shared -L/usr/local/lib -fstack-protector-strong S
VMLoc.o  -o ../blib/arch/auto/Bio/Tools/PSort/SVMLoc/SVMLoc.so  \
   -lm -lsvm -lstdc++ -L/usr/local/lib -lsvmloc   \
[...]
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-
e" "undef *Test::Harness::Switches; test_harness(1, '../blib/lib', '../blib/arch
')" t/*.t

#   Failed test 'use Bio::Tools::PSort::SVMLoc;'
#   at t/svmloc.t line 11.
#     Tried to use 'Bio::Tools::PSort::SVMLoc'.
#     Error:  Can't load '/<<BUILDDIR>>/psortb-3.0.5+dfsg/bio-tools-psort-svmloc
/../blib/arch/auto/Bio/Tools/PSort/SVMLoc/SVMLoc.so' for module Bio::Tools::PSor
t::SVMLoc: /usr/lib/x86_64-linux-gnu/libsvmloc.so.0: undefined symbol: svm_predi
ct at /usr/lib/x86_64-linux-gnu/perl/5.26/DynaLoader.pm line 187.
# ^@ at t/svmloc.t line 11.
# Compilation failed in require at t/svmloc.t line 11.
# BEGIN failed--compilation aborted at t/svmloc.t line 11.
[...]

  (https://launchpad.net/ubuntu/+source/psortb/3.0.5+dfsg-1)

Per <https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-Wl.2C--as-needed>,
libraries must be passed on the commandline after the objects which
reference them, otherwise they will be discarded by the linker, resulting in
errors such as the above.

I have uploaded the attached patch to psortb in Ubuntu.  Please consider
applying it in Debian as well.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
diff -Nru psortb-3.0.5+dfsg/debian/patches/remove-bundled-party-libsvm.patch psortb-3.0.5+dfsg/debian/patches/remove-bundled-party-libsvm.patch
--- psortb-3.0.5+dfsg/debian/patches/remove-bundled-party-libsvm.patch	2018-02-20 09:25:29.000000000 -0800
+++ psortb-3.0.5+dfsg/debian/patches/remove-bundled-party-libsvm.patch	2018-04-09 23:09:22.000000000 -0700
@@ -1,17 +1,23 @@
 Description: Remove source from bundled libsvm and adjust build system.
 Author: Carn? Draug <carandraug+dev at gmail.com>
-Last-Update: 2017-04-20
---- a/bio-tools-psort-svmloc/MANIFEST
-+++ b/bio-tools-psort-svmloc/MANIFEST
-@@ -8,5 +8,4 @@ bindings.h
+Author: Steve Langasek <steve.langasek at ubuntu.com>
+Last-Update: 2018-04-09
+
+Index: psortb-3.0.5+dfsg/bio-tools-psort-svmloc/MANIFEST
+===================================================================
+--- psortb-3.0.5+dfsg.orig/bio-tools-psort-svmloc/MANIFEST
++++ psortb-3.0.5+dfsg/bio-tools-psort-svmloc/MANIFEST
+@@ -8,5 +8,4 @@
  lib/Bio/Tools/PSort/SVMLoc.pm
  sample.model
  fre_patterns.txt
 -libsvm.h
  typemap
---- a/bio-tools-psort-svmloc/Makefile.PL
-+++ b/bio-tools-psort-svmloc/Makefile.PL
-@@ -9,7 +9,7 @@ $CC = 'g++';
+Index: psortb-3.0.5+dfsg/bio-tools-psort-svmloc/Makefile.PL
+===================================================================
+--- psortb-3.0.5+dfsg.orig/bio-tools-psort-svmloc/Makefile.PL
++++ psortb-3.0.5+dfsg/bio-tools-psort-svmloc/Makefile.PL
+@@ -9,7 +9,7 @@
  
  @libs = qw/svmloc/;
  %paths = ();
@@ -20,8 +26,19 @@
  
  $defaults_file = '../psortb.defaults';
  if( -f $defaults_file ) {
---- a/bio-tools-psort-svmloc/bindings.h
-+++ b/bio-tools-psort-svmloc/bindings.h
+@@ -24,7 +24,7 @@
+ if($additional_libpath) {
+     $libpath .= ' ' . $additional_libpath . ' ' . join(' ', map { '-l' . $_ } @libs);
+ } else {
+-    $libpath .= Bio::Tools::PSort::Install->makeLibPath(@libs);
++    $libpath = Bio::Tools::PSort::Install->makeLibPath(@libs) . " " . $libpath;
+ }
+ 
+ if($^O eq 'cygwin') {
+Index: psortb-3.0.5+dfsg/bio-tools-psort-svmloc/bindings.h
+===================================================================
+--- psortb-3.0.5+dfsg.orig/bio-tools-psort-svmloc/bindings.h
++++ psortb-3.0.5+dfsg/bio-tools-psort-svmloc/bindings.h
 @@ -9,7 +9,9 @@
  #include <set>
  #include <assert.h>


More information about the Debian-med-packaging mailing list