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