From: Stephane Glondu Date: Fri, 4 Sep 2020 04:24:26 +0000 (+0200) Subject: Fix static linking of lib{bfd,iberty} X-Git-Tag: archive/raspbian/4.11.1-5+rpi1~1^2~17 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d5da490ef5e3d1fdefbe31cd568136a441269569;p=ocaml.git Fix static linking of lib{bfd,iberty} --- 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 index 00000000..97f1c4c4 --- /dev/null +++ b/debian/patches/0008-Statically-link-lib-bfd-iberty.patch @@ -0,0 +1,23 @@ +From: Stephane Glondu +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 diff --git a/debian/patches/series b/debian/patches/series index b5479518..2d2b9bc4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -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 diff --git a/debian/rules b/debian/rules index 696d6c11..0c39a4a0 100755 --- a/debian/rules +++ b/debian/rules @@ -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