@@ -280,6 +280,7 @@ pub struct Config {
280280 pub llvm_profile_use : Option < String > ,
281281 pub llvm_profile_generate : bool ,
282282 pub llvm_libunwind_default : Option < LlvmLibunwind > ,
283+ pub llvm_libzstd_default : Option < bool > ,
283284 pub enable_bolt_settings : bool ,
284285
285286 pub reproducible_artifacts : Vec < String > ,
@@ -550,6 +551,7 @@ pub struct Target {
550551 /// Some(path to FileCheck) if one was specified.
551552 pub llvm_filecheck : Option < PathBuf > ,
552553 pub llvm_libunwind : Option < LlvmLibunwind > ,
554+ pub llvm_libzstd : Option < bool > ,
553555 pub cc : Option < PathBuf > ,
554556 pub cxx : Option < PathBuf > ,
555557 pub ar : Option < PathBuf > ,
@@ -1106,6 +1108,7 @@ define_config! {
11061108 jemalloc: Option <bool > = "jemalloc" ,
11071109 test_compare_mode: Option <bool > = "test-compare-mode" ,
11081110 llvm_libunwind: Option <String > = "llvm-libunwind" ,
1111+ llvm_libzstd: Option <bool > = "llvm-libzstd" ,
11091112 control_flow_guard: Option <bool > = "control-flow-guard" ,
11101113 ehcont_guard: Option <bool > = "ehcont-guard" ,
11111114 new_symbol_mangling: Option <bool > = "new-symbol-mangling" ,
@@ -1132,6 +1135,7 @@ define_config! {
11321135 llvm_has_rust_patches: Option <bool > = "llvm-has-rust-patches" ,
11331136 llvm_filecheck: Option <String > = "llvm-filecheck" ,
11341137 llvm_libunwind: Option <String > = "llvm-libunwind" ,
1138+ llvm_libzstd: Option <bool > = "llvm-libzstd" ,
11351139 sanitizers: Option <bool > = "sanitizers" ,
11361140 profiler: Option <StringOrBool > = "profiler" ,
11371141 rpath: Option <bool > = "rpath" ,
@@ -1633,6 +1637,7 @@ impl Config {
16331637 jemalloc,
16341638 test_compare_mode,
16351639 llvm_libunwind,
1640+ llvm_libzstd,
16361641 control_flow_guard,
16371642 ehcont_guard,
16381643 new_symbol_mangling,
@@ -1719,6 +1724,7 @@ impl Config {
17191724 set ( & mut config. ehcont_guard , ehcont_guard) ;
17201725 config. llvm_libunwind_default =
17211726 llvm_libunwind. map ( |v| v. parse ( ) . expect ( "failed to parse rust.llvm-libunwind" ) ) ;
1727+ config. llvm_libzstd_default = llvm_libzstd;
17221728
17231729 if let Some ( ref backends) = codegen_backends {
17241730 let available_backends = [ "llvm" , "cranelift" , "gcc" ] ;
@@ -1925,6 +1931,7 @@ impl Config {
19251931 panic ! ( "failed to parse target.{triple}.llvm-libunwind" )
19261932 } )
19271933 } ) ;
1934+ target. llvm_libzstd = cfg. llvm_libzstd ;
19281935 if let Some ( s) = cfg. no_std {
19291936 target. no_std = s;
19301937 }
@@ -2411,6 +2418,14 @@ impl Config {
24112418 } )
24122419 }
24132420
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+
24142429 pub fn split_debuginfo ( & self , target : TargetSelection ) -> SplitDebuginfo {
24152430 self . target_config
24162431 . get ( & target)
@@ -2715,6 +2730,7 @@ fn check_incompatible_options_for_ci_rustc(rust: &Rust) -> Result<(), String> {
27152730 remap_debuginfo : _,
27162731 test_compare_mode : _,
27172732 llvm_libunwind : _,
2733+ llvm_libzstd : _,
27182734 control_flow_guard : _,
27192735 ehcont_guard : _,
27202736 new_symbol_mangling : _,
0 commit comments