Skip to content

Commit 952d916

Browse files
committed
rewrite static-dylib-by-default to rmake
1 parent d111ccd commit 952d916

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ run-make/share-generics-dylib/Makefile
7777
run-make/simd-ffi/Makefile
7878
run-make/split-debuginfo/Makefile
7979
run-make/stable-symbol-names/Makefile
80-
run-make/static-dylib-by-default/Makefile
8180
run-make/staticlib-dylib-linkage/Makefile
8281
run-make/symbol-mangling-hashed/Makefile
8382
run-make/symbol-visibility/Makefile

tests/run-make/static-dylib-by-default/Makefile

-17
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// If a dylib is being produced, the compiler will first check to see if it can
2+
// be created entirely statically before falling back to dynamic dependencies. This
3+
// behavior can be overridden with `-C prefer-dynamic`.
4+
// In this test, bar depends on foo and is compiled fully statically despite the available
5+
// `foo` dynamic library. This allows the main binary to be executed in the final step.
6+
// See https://github.com/rust-lang/rust/commit/3036b001276a6e43409b08b7f2334ce72aeeb036
7+
8+
//@ ignore-cross-compile
9+
// Reason: the compiled binary is executed
10+
//FIXME(Oneirical): try on msvc, not because of an ignore but because i did wonky things
11+
12+
use run_make_support::{
13+
cc, cwd, dynamic_lib_name, extra_c_flags, has_extension, rfs, run, rustc, shallow_find_files,
14+
};
15+
16+
fn main() {
17+
rustc().input("foo.rs").run();
18+
rustc().input("bar.rs").run();
19+
cc().input("main.c").out_exe("main").arg(dynamic_lib_name("bar")).args(extra_c_flags()).run();
20+
for rlib in shallow_find_files(cwd(), |path| has_extension(path, "rlib")) {
21+
rfs::remove_file(rlib);
22+
}
23+
rfs::remove_file(dynamic_lib_name("foo"));
24+
run("main");
25+
}

0 commit comments

Comments
 (0)