Skip to content

Commit 3cc1056

Browse files
committed
rewrite export-executable-symbols to rmake
1 parent 2a3e4c5 commit 3cc1056

File tree

5 files changed

+30
-17
lines changed

5 files changed

+30
-17
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/dep-info-doesnt-run-much/Makefile
99
run-make/dep-info-spaces/Makefile
1010
run-make/dep-info/Makefile
1111
run-make/emit-to-stdout/Makefile
12-
run-make/export-executable-symbols/Makefile
1312
run-make/extern-fn-reachable/Makefile
1413
run-make/fmt-write-bloat/Makefile
1514
run-make/foreign-double-unwind/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,25 @@
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+
//@ only-unix
8+
// Reason: the export-executable-symbols flag only works on Unix
9+
// due to hardcoded platform-specific implementation
10+
// (See #85673)
11+
//@ ignore-wasm32
12+
//@ ignore-wasm64
13+
//@ ignore-none
14+
// Reason: no-std is not supported
15+
16+
use run_make_support::{bin_name, llvm_readobj, rustc};
17+
18+
fn main() {
19+
rustc().arg("-Zexport-executable-symbols").input("main.rs").crate_type("bin").run();
20+
llvm_readobj()
21+
.symbols()
22+
.input(bin_name("main"))
23+
.run()
24+
.assert_stdout_contains("exported_symbol");
25+
}

tests/run-make/foreign-rust-exceptions/rmake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
//@ needs-unwind
1111
// Reason: unwinding panics is exercised in this test
1212

13-
//FIXME(Oneirical): ignore-i686-pc-windows-gnu
14-
// This test doesn't work on 32-bit MinGW as cdylib has its own copy of unwinder
13+
//@ ignore-i686-pc-windows-gnu
14+
// Reason: This test doesn't work on 32-bit MinGW as cdylib has its own copy of unwinder
1515
// so cross-DLL unwinding does not work.
1616

1717
use run_make_support::{run_fail, rustc};

0 commit comments

Comments
 (0)