@@ -280,6 +280,7 @@ pub struct Config {
280
280
pub llvm_profile_use : Option < String > ,
281
281
pub llvm_profile_generate : bool ,
282
282
pub llvm_libunwind_default : Option < LlvmLibunwind > ,
283
+ pub llvm_libzstd_default : Option < bool > ,
283
284
pub enable_bolt_settings : bool ,
284
285
285
286
pub reproducible_artifacts : Vec < String > ,
@@ -545,6 +546,7 @@ pub struct Target {
545
546
/// Some(path to FileCheck) if one was specified.
546
547
pub llvm_filecheck : Option < PathBuf > ,
547
548
pub llvm_libunwind : Option < LlvmLibunwind > ,
549
+ pub llvm_libzstd : Option < bool > ,
548
550
pub cc : Option < PathBuf > ,
549
551
pub cxx : Option < PathBuf > ,
550
552
pub ar : Option < PathBuf > ,
@@ -1101,6 +1103,7 @@ define_config! {
1101
1103
jemalloc: Option <bool > = "jemalloc" ,
1102
1104
test_compare_mode: Option <bool > = "test-compare-mode" ,
1103
1105
llvm_libunwind: Option <String > = "llvm-libunwind" ,
1106
+ llvm_libzstd: Option <bool > = "llvm-libzstd" ,
1104
1107
control_flow_guard: Option <bool > = "control-flow-guard" ,
1105
1108
ehcont_guard: Option <bool > = "ehcont-guard" ,
1106
1109
new_symbol_mangling: Option <bool > = "new-symbol-mangling" ,
@@ -1127,6 +1130,7 @@ define_config! {
1127
1130
llvm_has_rust_patches: Option <bool > = "llvm-has-rust-patches" ,
1128
1131
llvm_filecheck: Option <String > = "llvm-filecheck" ,
1129
1132
llvm_libunwind: Option <String > = "llvm-libunwind" ,
1133
+ llvm_libzstd: Option <bool > = "llvm-libzstd" ,
1130
1134
sanitizers: Option <bool > = "sanitizers" ,
1131
1135
profiler: Option <StringOrBool > = "profiler" ,
1132
1136
rpath: Option <bool > = "rpath" ,
@@ -1628,6 +1632,7 @@ impl Config {
1628
1632
jemalloc,
1629
1633
test_compare_mode,
1630
1634
llvm_libunwind,
1635
+ llvm_libzstd,
1631
1636
control_flow_guard,
1632
1637
ehcont_guard,
1633
1638
new_symbol_mangling,
@@ -1714,6 +1719,7 @@ impl Config {
1714
1719
set ( & mut config. ehcont_guard , ehcont_guard) ;
1715
1720
config. llvm_libunwind_default =
1716
1721
llvm_libunwind. map ( |v| v. parse ( ) . expect ( "failed to parse rust.llvm-libunwind" ) ) ;
1722
+ config. llvm_libzstd_default = llvm_libzstd;
1717
1723
1718
1724
if let Some ( ref backends) = codegen_backends {
1719
1725
let available_backends = [ "llvm" , "cranelift" , "gcc" ] ;
@@ -1906,6 +1912,7 @@ impl Config {
1906
1912
panic ! ( "failed to parse target.{triple}.llvm-libunwind" )
1907
1913
} )
1908
1914
} ) ;
1915
+ target. llvm_libzstd = cfg. llvm_libzstd ;
1909
1916
if let Some ( s) = cfg. no_std {
1910
1917
target. no_std = s;
1911
1918
}
@@ -2392,6 +2399,14 @@ impl Config {
2392
2399
} )
2393
2400
}
2394
2401
2402
+ pub fn llvm_libzstd ( & self , target : TargetSelection ) -> bool {
2403
+ self . target_config
2404
+ . get ( & target)
2405
+ . and_then ( |t| t. llvm_libzstd )
2406
+ . or ( self . llvm_libzstd_default )
2407
+ . unwrap_or ( target. contains ( "linux" ) )
2408
+ }
2409
+
2395
2410
pub fn split_debuginfo ( & self , target : TargetSelection ) -> SplitDebuginfo {
2396
2411
self . target_config
2397
2412
. get ( & target)
@@ -2696,6 +2711,7 @@ fn check_incompatible_options_for_ci_rustc(rust: &Rust) -> Result<(), String> {
2696
2711
remap_debuginfo : _,
2697
2712
test_compare_mode : _,
2698
2713
llvm_libunwind : _,
2714
+ llvm_libzstd : _,
2699
2715
control_flow_guard : _,
2700
2716
ehcont_guard : _,
2701
2717
new_symbol_mangling : _,
0 commit comments