]> git.proxmox.com Git - rustc.git/commitdiff
Add a strong check that rustc_llvm is actually dynamically-linked
authorXimin Luo <infinity0@debian.org>
Mon, 17 Jul 2017 17:17:32 +0000 (19:17 +0200)
committerXimin Luo <infinity0@debian.org>
Mon, 17 Jul 2017 17:17:32 +0000 (19:17 +0200)
debian/patches/d-prefer-dynamic.patch [new file with mode: 0644]
debian/rules

diff --git a/debian/patches/d-prefer-dynamic.patch b/debian/patches/d-prefer-dynamic.patch
new file mode 100644 (file)
index 0000000..32bbb59
--- /dev/null
@@ -0,0 +1,16 @@
+Description: Prefer dynamic linking
+ As per Debian policy, we basically revert
+ https://github.com/rust-lang/rfcs/blob/master/text/0404-change-prefer-dynamic.md
+Author: Ximin Luo <infinity0@debian.org>
+Forwarded: not-needed
+--- a/src/librustc/session/config.rs
++++ b/src/librustc/session/config.rs
+@@ -846,7 +846,7 @@
+         "don't run LLVM's SLP vectorization pass"),
+     soft_float: bool = (false, parse_bool, [TRACKED],
+         "use soft float ABI (*eabihf targets only)"),
+-    prefer_dynamic: bool = (false, parse_bool, [TRACKED],
++    prefer_dynamic: bool = (true, parse_bool, [TRACKED],
+         "prefer dynamic linking to static linking"),
+     no_integrated_as: bool = (false, parse_bool, [TRACKED],
+         "use an external assembler rather than LLVM's integrated one"),
index 8c846003d3a327c1e34d8b773fa59700bdaf1c3d..e518f354bd0d5a8bfd14cd6a8d8b85c7186fba40 100755 (executable)
@@ -171,6 +171,13 @@ RUN_TESTS = \
        fi
 
 override_dh_auto_test-arch:
+# ensure that rustc_llvm is actually dynamically linked to libLLVM
+       set -e; find build/*/stage2/lib/rustlib/* -name '*rustc_llvm*.so' | \
+       while read x; do \
+               stat -c '%s %n' "$$x"; \
+               objdump -p "$$x" | grep -q "NEEDED.*LLVM"; \
+               test "$$(stat -c %s "$$x")" -lt 6000000; \
+       done
 ifeq (, $(filter nocheck,$(DEB_BUILD_OPTIONS)))
        $(call RUN_TESTS,RUST_BACKTRACE=1 $(RUSTBUILD) test $(RUSTBUILD_FLAGS))
 endif