@@ -1725,6 +1725,28 @@ impl<'test> TestCx<'test> {
1725
1725
}
1726
1726
}
1727
1727
1728
+ fn is_vxworks_pure_static ( & self ) -> bool {
1729
+ if self . config . target . contains ( "vxworks" ) {
1730
+ match env:: var ( "RUST_TEST_DYLINK" ) {
1731
+ Ok ( s) => s != "1" ,
1732
+ _ => true
1733
+ }
1734
+ } else {
1735
+ false
1736
+ }
1737
+ }
1738
+
1739
+ fn is_vxworks_pure_dynamic ( & self ) -> bool {
1740
+ if self . config . target . contains ( "vxworks" ) {
1741
+ match env:: var ( "RUST_TEST_DYLINK" ) {
1742
+ Ok ( s) => s == "1" ,
1743
+ _ => false
1744
+ }
1745
+ } else {
1746
+ false
1747
+ }
1748
+ }
1749
+
1728
1750
fn compose_and_run_compiler ( & self , mut rustc : Command , input : Option < String > ) -> ProcRes {
1729
1751
let aux_dir = self . aux_output_dir_name ( ) ;
1730
1752
@@ -1768,6 +1790,7 @@ impl<'test> TestCx<'test> {
1768
1790
&& !self . config . host . contains ( "musl" ) )
1769
1791
|| self . config . target . contains ( "wasm32" )
1770
1792
|| self . config . target . contains ( "nvptx" )
1793
+ || self . is_vxworks_pure_static ( )
1771
1794
{
1772
1795
// We primarily compile all auxiliary libraries as dynamic libraries
1773
1796
// to avoid code size bloat and large binaries as much as possible
@@ -1999,7 +2022,8 @@ impl<'test> TestCx<'test> {
1999
2022
}
2000
2023
2001
2024
if !is_rustdoc {
2002
- if self . config . target == "wasm32-unknown-unknown" {
2025
+ if self . config . target == "wasm32-unknown-unknown"
2026
+ || self . is_vxworks_pure_static ( ) {
2003
2027
// rustc.arg("-g"); // get any backtrace at all on errors
2004
2028
} else if !self . props . no_prefer_dynamic {
2005
2029
rustc. args ( & [ "-C" , "prefer-dynamic" ] ) ;
@@ -2044,7 +2068,8 @@ impl<'test> TestCx<'test> {
2044
2068
}
2045
2069
2046
2070
// Use dynamic musl for tests because static doesn't allow creating dylibs
2047
- if self . config . host . contains ( "musl" ) {
2071
+ if self . config . host . contains ( "musl" )
2072
+ || self . is_vxworks_pure_dynamic ( ) {
2048
2073
rustc. arg ( "-Ctarget-feature=-crt-static" ) ;
2049
2074
}
2050
2075
0 commit comments