Skip to content

Commit 5f2b47f

Browse files
committed
rewrite native-link-modifier-verbatim-rustc to rmake
1 parent 8ece5ce commit 5f2b47f

File tree

3 files changed

+44
-13
lines changed

3 files changed

+44
-13
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ run-make/mixing-libs/Makefile
143143
run-make/msvc-opt-minsize/Makefile
144144
run-make/native-link-modifier-bundle/Makefile
145145
run-make/native-link-modifier-verbatim-linker/Makefile
146-
run-make/native-link-modifier-verbatim-rustc/Makefile
147146
run-make/native-link-modifier-whole-archive/Makefile
148147
run-make/no-alloc-shim/Makefile
149148
run-make/no-builtins-attribute/Makefile

tests/run-make/native-link-modifier-verbatim-rustc/Makefile

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// `verbatim` is a native link modifier that forces rustc to only accept libraries with
2+
// a specified name. This test checks that this modifier works as intended.
3+
// See https://github.com/rust-lang/rust/issues/99425
4+
5+
use run_make_support::rustc;
6+
7+
fn main() {
8+
// Verbatim allows for the specification of a precise name - in this case, the unconventional ".ext" extension.
9+
rustc()
10+
.input("upstream_native_dep.rs")
11+
.crate_type("staticlib")
12+
.output("upstream_some_strange_name.ext")
13+
.run();
14+
rustc()
15+
.input("rust_dep.rs")
16+
.crate_type("rlib")
17+
.arg("-lstatic:+verbatim=upstream_some_strange_name.ext")
18+
.run();
19+
20+
// This section voluntarily avoids using static_lib_name helpers to be verbatim.
21+
// With verbatim, even these common library names are refused - it wants upstream_native_dep without
22+
// any file extensions.
23+
rustc()
24+
.input("upstream_native_dep.rs")
25+
.crate_type("staticlib")
26+
.output("libupstream_native_dep.a")
27+
.run();
28+
rustc()
29+
.input("upstream_native_dep.rs")
30+
.crate_type("staticlib")
31+
.output("upstream_native_dep.a")
32+
.run();
33+
rustc()
34+
.input("upstream_native_dep.rs")
35+
.crate_type("staticlib")
36+
.output("upstream_native_dep.lib")
37+
.run();
38+
rustc()
39+
.input("rust_dep.rs")
40+
.crate_type("rlib")
41+
.arg("-lstatic:+verbatim=upstream_native_dep")
42+
.run_fail()
43+
.assert_stderr_contains("upstream_native_dep");
44+
}

0 commit comments

Comments
 (0)