Bug#889525: pytsk: Please make build compatible with -Wl,--as-needed

Steve Langasek steve.langasek at canonical.com
Sun Feb 4 08:06:55 UTC 2018


Package: pytsk
Version: 20171108-1
Severity: wishlist
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu bionic ubuntu-patch

Dear Hilko,

The latest version of pytsk has failed to build in Ubuntu, because the
changes to make pytsk statically link libtsk cause flags to be passed in a
way that's incompatible with -Wl,--as-needed, which is a default linker flag
in Ubuntu.

The attached debdiff updates your patch to setup.py so that dependent
libraries are listed last on the linker line, fixing the build failure in
Ubuntu.  Please consider applying it in Debian.

-- 
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 pytsk-20171108/debian/patches/0001-Link-system-tsk-statically-talloc-dynamically-instea.patch pytsk-20171108/debian/patches/0001-Link-system-tsk-statically-talloc-dynamically-instea.patch
--- pytsk-20171108/debian/patches/0001-Link-system-tsk-statically-talloc-dynamically-instea.patch	2017-11-09 13:30:00.000000000 -0800
+++ pytsk-20171108/debian/patches/0001-Link-system-tsk-statically-talloc-dynamically-instea.patch	2018-02-04 00:00:28.000000000 -0800
@@ -7,11 +7,11 @@
  setup.py | 44 ++++++++++++--------------------------------
  1 file changed, 12 insertions(+), 32 deletions(-)
 
-diff --git a/setup.py b/setup.py
-index b803021..e8db4c3 100755
---- a/setup.py
-+++ b/setup.py
-@@ -178,9 +178,9 @@ class BuildExtCommand(build_ext):
+Index: pytsk-20171108/setup.py
+===================================================================
+--- pytsk-20171108.orig/setup.py
++++ pytsk-20171108/setup.py
+@@ -178,9 +178,9 @@
    def run(self):
      compiler = new_compiler(compiler=self.compiler)
      # pylint: disable=attribute-defined-outside-init
@@ -23,7 +23,7 @@
  
      if not os.access("pytsk3.c", os.R_OK):
        # Generate the Python binding code (pytsk3.c).
-@@ -202,7 +202,7 @@ class BuildExtCommand(build_ext):
+@@ -202,7 +202,7 @@
  class SDistCommand(sdist):
    """Custom handler for generating source dist."""
    def run(self):
@@ -32,7 +32,7 @@
  
      # sleuthkit submodule is not there, probably because this has been
      # freshly checked out.
-@@ -280,32 +280,10 @@ class UpdateCommand(Command):
+@@ -280,32 +280,10 @@
      subprocess.check_call(["git", "apply", patch_file], cwd="sleuthkit")
  
    def run(self):
@@ -66,7 +66,7 @@
  
      # Generate the Python binding code (pytsk3.c).
      libtsk_header_files = [
-@@ -340,16 +318,18 @@ class ProjectBuilder(object):
+@@ -340,16 +318,19 @@
      # The args for the extension builder.
      self.extension_args = {
          "define_macros": [],
@@ -76,10 +76,11 @@
 -        "libraries": []}
 +        "libraries": [
 +          "talloc",
-+          # required by statically linked libtsk
-+          "afflib", "ewf", "stdc++", "z",
 +        ],
-+        "extra_link_args": ["-Wl,-Bstatic", "-ltsk", "-Wl,-Bdynamic"]}
++        "extra_link_args": [
++          "-Wl,-Bstatic", "-ltsk", "-Wl,-Bdynamic",
++          "-lafflib", "-lewf", "-lstdc++", "-lz",
++        ]}
  
      # The sources to build.
      self._source_files = [


More information about the forensics-devel mailing list