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> {
1842
1842
None => { }
1843
1843
}
1844
1844
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" ) {
1846
1849
self . maybe_add_external_args ( & mut rustc,
1847
1850
self . split_maybe_args ( & self . config . host_rustcflags ) ) ;
1848
1851
} else {
@@ -1855,6 +1858,11 @@ impl<'test> TestCx<'test> {
1855
1858
}
1856
1859
}
1857
1860
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
+
1858
1866
rustc. args ( & self . props . compile_flags ) ;
1859
1867
1860
1868
rustc
You can’t perform that action at this time.
0 commit comments