Skip to content

Commit

Permalink
rewrite mixing-libs to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jun 14, 2024
1 parent 779f8af commit 98ea1f7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ run-make/min-global-align/Makefile
run-make/mingw-export-call-convention/Makefile
run-make/mismatching-target-triples/Makefile
run-make/missing-crate-dependency/Makefile
run-make/mixing-libs/Makefile
run-make/msvc-opt-minsize/Makefile
run-make/native-link-modifier-bundle/Makefile
run-make/native-link-modifier-verbatim-linker/Makefile
Expand Down
8 changes: 0 additions & 8 deletions tests/run-make/mixing-libs/Makefile

This file was deleted.

21 changes: 21 additions & 0 deletions tests/run-make/mixing-libs/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Having multiple upstream crates available in different formats
// should result in failed compilation. This test causes multiple
// libraries to exist simultaneously as rust libs and dynamic libs,
// causing prog.rs to fail compilation.
// See https://github.com/rust-lang/rust/issues/10434

//@ ignore-cross-compile

use run_make_support::{remove_dylibs, rustc};

fn main() {
rustc().input("rlib.rs").crate_type("rlib").crate_type("dylib").run();

// Not putting `-C prefer-dynamic` here allows for static linking of librlib.rlib.
rustc().input("dylib.rs").run();

// librlib's dynamic version needs to be removed here to prevent prog.rs from fetching
// the wrong one.
remove_dylibs("rlib");
rustc().input("prog.rs").run_fail();
}

0 comments on commit 98ea1f7

Please sign in to comment.