3 files changed +28
-22
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ run-make/reproducible-build/Makefile
31
31
run-make/rlib-format-packed-bundled-libs/Makefile
32
32
run-make/simd-ffi/Makefile
33
33
run-make/split-debuginfo/Makefile
34
- run-make/staticlib-dylib-linkage/Makefile
35
34
run-make/symbol-mangling-hashed/Makefile
36
35
run-make/sysroot-crates-are-unstable/Makefile
37
36
run-make/thumb-none-cortex-m/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ //@ ignore-cross-compile
2
+ // Reason: the compiled binary is executed.
3
+ //@ ignore-wasm
4
+ // Reason: WASM does not support dynamic libraries
5
+ //@ ignore-msvc
6
+ //FIXME(Oneirical): Getting this to work on MSVC requires passing libcmt.lib to CC,
7
+ // which is not trivial to do.
8
+ // Tracking issue: https://github.com/rust-lang/rust/issues/128602
9
+ // Discussion: https://github.com/rust-lang/rust/pull/128407#discussion_r1702439172
10
+
11
+ use run_make_support:: { cc, regex, run, rustc} ;
12
+
13
+ fn main ( ) {
14
+ rustc ( ) . arg ( "-Cprefer-dynamic" ) . input ( "bar.rs" ) . run ( ) ;
15
+ let libs = rustc ( )
16
+ . input ( "foo.rs" )
17
+ . crate_type ( "staticlib" )
18
+ . print ( "native-static-libs" )
19
+ . arg ( "-Zstaticlib-allow-rdylib-deps" )
20
+ . run ( )
21
+ . assert_stderr_contains ( "note: native-static-libs: " )
22
+ . stderr_utf8 ( ) ;
23
+ let re = regex:: Regex :: new ( r#"note: native-static-libs:\s*(.+)"# ) . unwrap ( ) ;
24
+ let libs = re. find ( & libs) . unwrap ( ) . as_str ( ) . trim ( ) ;
25
+ let libs: & Vec < & str > = & libs[ libs. find ( "-L" ) . unwrap ( ) ..libs. len ( ) ] . split ( ' ' ) . collect ( ) ;
26
+ cc ( ) . input ( "foo.c" ) . arg ( "-lfoo" ) . args ( libs) . out_exe ( "foo" ) . run ( ) ;
27
+ run ( "foo" ) ;
28
+ }
0 commit comments