@@ -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 > ,
@@ -550,6 +551,7 @@ pub struct Target {
550
551
/// Some(path to FileCheck) if one was specified.
551
552
pub llvm_filecheck : Option < PathBuf > ,
552
553
pub llvm_libunwind : Option < LlvmLibunwind > ,
554
+ pub llvm_libzstd : Option < bool > ,
553
555
pub cc : Option < PathBuf > ,
554
556
pub cxx : Option < PathBuf > ,
555
557
pub ar : Option < PathBuf > ,
@@ -1106,6 +1108,7 @@ define_config! {
1106
1108
jemalloc: Option <bool > = "jemalloc" ,
1107
1109
test_compare_mode: Option <bool > = "test-compare-mode" ,
1108
1110
llvm_libunwind: Option <String > = "llvm-libunwind" ,
1111
+ llvm_libzstd: Option <bool > = "llvm-libzstd" ,
1109
1112
control_flow_guard: Option <bool > = "control-flow-guard" ,
1110
1113
ehcont_guard: Option <bool > = "ehcont-guard" ,
1111
1114
new_symbol_mangling: Option <bool > = "new-symbol-mangling" ,
@@ -1132,6 +1135,7 @@ define_config! {
1132
1135
llvm_has_rust_patches: Option <bool > = "llvm-has-rust-patches" ,
1133
1136
llvm_filecheck: Option <String > = "llvm-filecheck" ,
1134
1137
llvm_libunwind: Option <String > = "llvm-libunwind" ,
1138
+ llvm_libzstd: Option <bool > = "llvm-libzstd" ,
1135
1139
sanitizers: Option <bool > = "sanitizers" ,
1136
1140
profiler: Option <StringOrBool > = "profiler" ,
1137
1141
rpath: Option <bool > = "rpath" ,
@@ -1633,6 +1637,7 @@ impl Config {
1633
1637
jemalloc,
1634
1638
test_compare_mode,
1635
1639
llvm_libunwind,
1640
+ llvm_libzstd,
1636
1641
control_flow_guard,
1637
1642
ehcont_guard,
1638
1643
new_symbol_mangling,
@@ -1719,6 +1724,7 @@ impl Config {
1719
1724
set ( & mut config. ehcont_guard , ehcont_guard) ;
1720
1725
config. llvm_libunwind_default =
1721
1726
llvm_libunwind. map ( |v| v. parse ( ) . expect ( "failed to parse rust.llvm-libunwind" ) ) ;
1727
+ config. llvm_libzstd_default = llvm_libzstd;
1722
1728
1723
1729
if let Some ( ref backends) = codegen_backends {
1724
1730
let available_backends = [ "llvm" , "cranelift" , "gcc" ] ;
@@ -1925,6 +1931,7 @@ impl Config {
1925
1931
panic ! ( "failed to parse target.{triple}.llvm-libunwind" )
1926
1932
} )
1927
1933
} ) ;
1934
+ target. llvm_libzstd = cfg. llvm_libzstd ;
1928
1935
if let Some ( s) = cfg. no_std {
1929
1936
target. no_std = s;
1930
1937
}
@@ -2411,6 +2418,14 @@ impl Config {
2411
2418
} )
2412
2419
}
2413
2420
2421
+ pub fn llvm_libzstd ( & self , target : TargetSelection ) -> bool {
2422
+ self . target_config
2423
+ . get ( & target)
2424
+ . and_then ( |t| t. llvm_libzstd )
2425
+ . or ( self . llvm_libzstd_default )
2426
+ . unwrap_or ( target. contains ( "linux" ) )
2427
+ }
2428
+
2414
2429
pub fn split_debuginfo ( & self , target : TargetSelection ) -> SplitDebuginfo {
2415
2430
self . target_config
2416
2431
. get ( & target)
@@ -2715,6 +2730,7 @@ fn check_incompatible_options_for_ci_rustc(rust: &Rust) -> Result<(), String> {
2715
2730
remap_debuginfo : _,
2716
2731
test_compare_mode : _,
2717
2732
llvm_libunwind : _,
2733
+ llvm_libzstd : _,
2718
2734
control_flow_guard : _,
2719
2735
ehcont_guard : _,
2720
2736
new_symbol_mangling : _,
0 commit comments