Skip to content

Commit 57621cb

Browse files
committed
rewrite mixing-libs to rmake
1 parent 779f8af commit 57621cb

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ run-make/min-global-align/Makefile
139139
run-make/mingw-export-call-convention/Makefile
140140
run-make/mismatching-target-triples/Makefile
141141
run-make/missing-crate-dependency/Makefile
142-
run-make/mixing-libs/Makefile
143142
run-make/msvc-opt-minsize/Makefile
144143
run-make/native-link-modifier-bundle/Makefile
145144
run-make/native-link-modifier-verbatim-linker/Makefile

tests/run-make/mixing-libs/Makefile

-8
This file was deleted.

tests/run-make/mixing-libs/rmake.rs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Having multiple upstream crates available in different formats
2+
// should result in failed compilation. This test causes multiple
3+
// libraries to exist simultaneously as rust libs and dynamic libs,
4+
// causing prog.rs to fail compilation.
5+
// See https://github.com/rust-lang/rust/issues/10434
6+
7+
//@ ignore-cross-compile
8+
9+
use run_make_support::{remove_dylibs, rustc};
10+
11+
fn main() {
12+
rustc().input("rlib.rs").crate_type("rlib").crate_type("dylib").run();
13+
14+
// Not putting -C prefer dynamic here allows for static linking of librlib.rlib.
15+
rustc().input("dylib.rs").run();
16+
17+
// librlib's dynamic version needs to be removed here to prevent prog.rs from fetching
18+
// the wrong one.
19+
remove_dylibs("rlib");
20+
rustc().input("prog.rs").run_fail();
21+
}

0 commit comments

Comments
 (0)