Skip to content

Commit

Permalink
Rollup merge of rust-lang#94023 - krasimirgg:head-llvm-use-llvm-nm, r…
Browse files Browse the repository at this point in the history
…=Mark-Simulacrum

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 rust-lang#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).
  • Loading branch information
matthiaskrgr authored Feb 19, 2022
2 parents 968f306 + 0647e38 commit 301e767
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,7 @@ impl Step for RustDev {
"llvm-bcanalyzer",
"llvm-cov",
"llvm-dwp",
"llvm-nm",
] {
tarball.add_file(src_bindir.join(exe(bin, target)), "bin", 0o755);
}
Expand Down
6 changes: 4 additions & 2 deletions src/test/run-make-fulldeps/static-nobundle/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 301e767

Please sign in to comment.