Skip to content

Commit 0d27c7b

Browse files
committed
rewrite export-executable-symbols to rmake
1 parent 639b56c commit 0d27c7b

File tree

4 files changed

+25
-15
lines changed

4 files changed

+25
-15
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ run-make/dep-info-spaces/Makefile
1313
run-make/dep-info/Makefile
1414
run-make/dump-ice-to-disk/Makefile
1515
run-make/emit-to-stdout/Makefile
16-
run-make/export-executable-symbols/Makefile
1716
run-make/extern-diff-internal-name/Makefile
1817
run-make/extern-flag-disambiguates/Makefile
1918
run-make/extern-fn-reachable/Makefile

tests/run-make/c-unwind-abi-catch-lib-panic/rmake.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//@ needs-unwind
99
// Reason: this test exercises unwinding a panic
1010

11-
use run_make_support::{cc, is_msvc, llvm_ar, run, rustc};
11+
use run_make_support::{cc, is_msvc, llvm_ar, run, rustc, static_lib_name};
1212

1313
fn main() {
1414
// Compile `add.c` into an object file.
@@ -25,9 +25,9 @@ fn main() {
2525

2626
// Now, create an archive using these two objects.
2727
if is_msvc() {
28-
llvm_ar().obj_to_ar().args(&["libadd.a", "add.obj", "panic.o"]).run();
28+
llvm_ar().obj_to_ar().args(&[&static_lib_name("add"), "add.obj", "panic.o"]).run();
2929
} else {
30-
llvm_ar().obj_to_ar().args(&["libadd.a", "add.o", "panic.o"]).run();
30+
llvm_ar().obj_to_ar().args(&[&static_lib_name("add"), "add.o", "panic.o"]).run();
3131
};
3232

3333
// Compile `main.rs`, which will link into our library, and run it.

tests/run-make/export-executable-symbols/Makefile

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// The unstable flag `-Z export-executable-symbols` exports symbols from executables, as if
2+
// they were dynamic libraries. This test is a simple smoke test to check that this feature
3+
// works by using it in compilation, then checking that the output binary contains the exported
4+
// symbol.
5+
// See https://github.com/rust-lang/rust/pull/85673
6+
7+
//@ ignore-wasm32
8+
//@ ignore-wasm64
9+
//@ ignore-none
10+
// Reason: no-std is not supported
11+
//FIXME(Oneirical): try it on more than only-linux
12+
13+
use run_make_support::{bin_name, llvm_readobj, rustc};
14+
15+
fn main() {
16+
rustc().arg("-Zexport-executable-symbols").input("main.rs").crate_type("bin").run();
17+
llvm_readobj()
18+
.symbols()
19+
.input(bin_name("main"))
20+
.run()
21+
.assert_stdout_contains("exported_symbol");
22+
}

0 commit comments

Comments
 (0)