Skip to content

Commit ece7d98

Browse files
committed
rewrite mixing-libs to rmake
1 parent d9162fd commit ece7d98

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
@@ -90,7 +90,6 @@ run-make/manual-link/Makefile
9090
run-make/metadata-dep-info/Makefile
9191
run-make/min-global-align/Makefile
9292
run-make/missing-crate-dependency/Makefile
93-
run-make/mixing-libs/Makefile
9493
run-make/native-link-modifier-bundle/Makefile
9594
run-make/native-link-modifier-whole-archive/Makefile
9695
run-make/no-alloc-shim/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)