Fix static linking of lib{bfd,iberty}
authorStephane Glondu <steph@glondu.net>
Fri, 4 Sep 2020 04:24:26 +0000 (06:24 +0200)
committerStéphane Glondu <glondu@debian.org>
Fri, 4 Sep 2020 05:12:11 +0000 (07:12 +0200)
debian/patches/0008-Statically-link-lib-bfd-iberty.patch [new file with mode: 0644]
debian/patches/series
debian/rules

diff --git a/debian/patches/0008-Statically-link-lib-bfd-iberty.patch b/debian/patches/0008-Statically-link-lib-bfd-iberty.patch
new file mode 100644 (file)
index 0000000..97f1c4c
--- /dev/null
@@ -0,0 +1,23 @@
+From: Stephane Glondu <steph@glondu.net>
+Date: Fri, 4 Sep 2020 06:23:06 +0200
+Subject: Statically link lib{bfd,iberty}
+
+---
+ configure.ac | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index ab1e188..b3ebe74 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1680,6 +1680,10 @@ AS_IF([test x"$with_bfd" != "xno"],
+     'ocamlobjinfo' will be unable to display info on .cmxs files.
+     ]))])
++## Statically link libbfd and libiberty to avoid a versioned dependency
++## too constrained on libbinutils
++bfd_ldlibs="$(echo $bfd_ldlibs | sed 's/-lbfd/-Wl,-Bstatic -lbfd -liberty -Wl,-Bdynamic -lz -ldl/')"
++
+ ## Does the assembler support debug prefix map and CFI directives
+ as_has_debug_prefix_map=false
+ asm_cfi_supported=false
index b547951826cc9db0c3e33f2bd3ff34f337200165..2d2b9bc4a959d743dfe35b33008011dc4983c957 100644 (file)
@@ -5,3 +5,4 @@
 0005-read_main_debug_info-do-not-die-in-custom-executable.patch
 0006-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch
 0007-Trigger-output-complete-exe-on-custom-with-an-enviro.patch
+0008-Statically-link-lib-bfd-iberty.patch
index 696d6c117bdc58d20f248c8491e16ebb9427efb0..0c39a4a022457aa1ff85f83738ebd91bba314e96 100755 (executable)
@@ -60,9 +60,6 @@ CONFIGURE_OPTS := \
   --with-x \
   -mandir $(DEB_TEST_BUILD_PREFIX)/usr/share/man \
 
-CONFIGURE_SED := \
-  -e "/LIBBFD_LINK/s%-lbfd%-Wl,-Bstatic -lbfd -liberty -Wl,-Bdynamic -lz -ldl%"
-
 # Upstream recommends dropping support on armel, see https://github.com/ocaml/ocaml/issues/7642
 # Binaries generated by ocamlopt segfault on x32
 # ld reports spurious messages on powerpc, see https://github.com/ocaml/ocaml/issues/8846
@@ -127,7 +124,6 @@ override_dh_auto_configure: config-stamp ocamlinit-stamp
 
 config-stamp: pre-config-stamp
        ./configure $(CONFIGURE_OPTS)
-       sed -i $(CONFIGURE_SED) Makefile.config
        touch $@
 
 ocamlinit-stamp: $(TARBALL_TARGET) config-stamp