Skip to content

Commit 9d055b0

Browse files
committed
rewrite cdylib-fewer-symbols to rmake
1 parent c35510f commit 9d055b0

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ run-make/c-unwind-abi-catch-lib-panic/Makefile
99
run-make/c-unwind-abi-catch-panic/Makefile
1010
run-make/cat-and-grep-sanity-check/Makefile
1111
run-make/cdylib-dylib-linkage/Makefile
12-
run-make/cdylib-fewer-symbols/Makefile
1312
run-make/compiler-lookup-paths-2/Makefile
1413
run-make/compiler-lookup-paths/Makefile
1514
run-make/compiler-rt-works-on-mingw/Makefile

tests/run-make/cdylib-fewer-symbols/Makefile

-15
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Symbols related to the allocator should be hidden and not exported from a cdylib,
2+
// for they are internal to Rust
3+
// and not part of the public ABI (application binary interface). This test checks that
4+
// four such symbols are successfully hidden.
5+
// See https://github.com/rust-lang/rust/pull/45710
6+
7+
//FIXME(Oneirical): try it on windows, restore ignore
8+
// See https://github.com/rust-lang/rust/pull/46207#issuecomment-347561753
9+
//FIXME(Oneirical): I also removed cross-compile ignore since there is no binary execution
10+
11+
use run_make_support::{dynamic_lib_name, llvm_readobj, rustc};
12+
13+
fn main() {
14+
// Compile a cdylib
15+
rustc().input("foo.rs").run();
16+
let out = llvm_readobj().arg("--symbols").input(dynamic_lib_name("foo")).run().stdout_utf8();
17+
let out = // All hidden symbols must be removed.
18+
out.lines().filter(|&line| !line.trim().contains("HIDDEN")).collect::<Vec<_>>().join("\n");
19+
assert!(!&out.contains("__rdl_"));
20+
assert!(!&out.contains("__rde_"));
21+
assert!(!&out.contains("__rg_"));
22+
assert!(!&out.contains("__ruse_"));
23+
}

0 commit comments

Comments
 (0)