From 4b5beae0b2626bd8936856494b06d60b9a6e42ac Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Tue, 15 Feb 2022 15:17:22 +0100 Subject: [PATCH 1/2] adapt static-nobundle test to use llvm-nm No functional changes intended. This updates the test case to use llvm-nm instead of the system nm. This fixes an instance over at the experimental build of rustc with HEAD LLVM: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/8380#ef6f41b5-8595-49a6-be37-0eff80e0ccb5 It is related to https://github.com/rust-lang/rust/pull/94001. The issue is that this test uses the system nm, which may not be recent enough to understand the update to uwtable. This replaces the test to use the llvm-nm that should be recent enough (consistent with the LLVM sources we use to build rustc). --- src/test/run-make-fulldeps/static-nobundle/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/run-make-fulldeps/static-nobundle/Makefile b/src/test/run-make-fulldeps/static-nobundle/Makefile index 8f78c401a1141..001081798a6e4 100644 --- a/src/test/run-make-fulldeps/static-nobundle/Makefile +++ b/src/test/run-make-fulldeps/static-nobundle/Makefile @@ -9,8 +9,10 @@ all: $(call NATIVE_STATICLIB,aaa) $(RUSTC) bbb.rs --crate-type=rlib # Check that bbb does NOT contain the definition of `native_func` - nm $(TMPDIR)/libbbb.rlib | $(CGREP) -ve "T _*native_func" - nm $(TMPDIR)/libbbb.rlib | $(CGREP) -e "U _*native_func" + # We're using the llvm-nm instead of the system nm to ensure it + # is compatible with the LLVM bitcode generated by rustc. + "$(LLVM_BIN_DIR)/llvm-nm" $(TMPDIR)/libbbb.rlib | $(CGREP) -ve "T _*native_func" + "$(LLVM_BIN_DIR)/llvm-nm" $(TMPDIR)/libbbb.rlib | $(CGREP) -e "U _*native_func" # Check that aaa gets linked (either as `-l aaa` or `aaa.lib`) when building ccc. $(RUSTC) ccc.rs -C prefer-dynamic --crate-type=dylib --print link-args | $(CGREP) -e '-l[" ]*aaa|aaa\.lib' From 0647e3890435b387f7815e0e9bfb1786e1787d9f Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Wed, 16 Feb 2022 14:13:09 +0100 Subject: [PATCH 2/2] add llvm-nm to bootstrap dist bin's --- src/bootstrap/dist.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 472ee3fb01474..17a8fde0ccfea 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -2060,6 +2060,7 @@ impl Step for RustDev { "llvm-bcanalyzer", "llvm-cov", "llvm-dwp", + "llvm-nm", ] { tarball.add_file(src_bindir.join(exe(bin, target)), "bin", 0o755); }