File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1842,7 +1842,10 @@ impl<'test> TestCx<'test> {
18421842 None => { }
18431843 }
18441844
1845- if self . props . force_host {
1845+ // Musl toolchain is build on linux-gnu host
1846+ // but with proper setup it can behave almost* like native linux-musl.
1847+ // One difference is "cc" which will link to glibc; force musl cc.
1848+ if self . props . force_host && !self . config . target . contains ( "musl" ) {
18461849 self . maybe_add_external_args ( & mut rustc,
18471850 self . split_maybe_args ( & self . config . host_rustcflags ) ) ;
18481851 } else {
@@ -1855,6 +1858,11 @@ impl<'test> TestCx<'test> {
18551858 }
18561859 }
18571860
1861+ // Use dynamic musl for tests because static doesn't allow creating dylibs
1862+ if self . config . target . contains ( "musl" ) {
1863+ rustc. arg ( "-Ctarget-feature=-crt-static" ) ;
1864+ }
1865+
18581866 rustc. args ( & self . props . compile_flags ) ;
18591867
18601868 rustc
You can’t perform that action at this time.
0 commit comments