--- /dev/null
+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"),
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