@@ -47,8 +47,8 @@ use crate::core::config::toml::rust::{
4747} ;
4848use crate :: core:: config:: toml:: target:: Target ;
4949use crate :: core:: config:: {
50- DebuginfoLevel , DryRun , GccCiMode , LlvmLibunwind , Merge , ReplaceOpt , RustcLto , SplitDebuginfo ,
51- StringOrBool , set, threads_from_config,
50+ CompilerBuiltins , DebuginfoLevel , DryRun , GccCiMode , LlvmLibunwind , Merge , ReplaceOpt ,
51+ RustcLto , SplitDebuginfo , StringOrBool , set, threads_from_config,
5252} ;
5353use crate :: core:: download:: {
5454 DownloadContext , download_beta_toolchain, is_download_ci_available, maybe_download_rustfmt,
@@ -122,8 +122,7 @@ pub struct Config {
122122 pub patch_binaries_for_nix : Option < bool > ,
123123 pub stage0_metadata : build_helper:: stage0_parser:: Stage0 ,
124124 pub android_ndk : Option < PathBuf > ,
125- /// Whether to use the `c` feature of the `compiler_builtins` crate.
126- pub optimized_compiler_builtins : bool ,
125+ pub optimized_compiler_builtins : CompilerBuiltins ,
127126
128127 pub stdout_is_tty : bool ,
129128 pub stderr_is_tty : bool ,
@@ -1317,7 +1316,11 @@ impl Config {
13171316 }
13181317
13191318 config. optimized_compiler_builtins =
1320- build_optimized_compiler_builtins. unwrap_or ( config. channel != "dev" ) ;
1319+ build_optimized_compiler_builtins. unwrap_or ( if config. channel == "dev" {
1320+ CompilerBuiltins :: BuildRustOnly
1321+ } else {
1322+ CompilerBuiltins :: BuildLLVMFuncs
1323+ } ) ;
13211324 config. compiletest_diff_tool = build_compiletest_diff_tool;
13221325 config. compiletest_use_stage0_libtest =
13231326 build_compiletest_use_stage0_libtest. unwrap_or ( true ) ;
@@ -1767,19 +1770,11 @@ impl Config {
17671770 self . target_config . get ( & target) . and_then ( |t| t. rpath ) . unwrap_or ( self . rust_rpath )
17681771 }
17691772
1770- pub fn optimized_compiler_builtins ( & self , target : TargetSelection ) -> bool {
1773+ pub fn optimized_compiler_builtins ( & self , target : TargetSelection ) -> & CompilerBuiltins {
17711774 self . target_config
17721775 . get ( & target)
17731776 . and_then ( |t| t. optimized_compiler_builtins . as_ref ( ) )
1774- . map ( StringOrBool :: is_string_or_true)
1775- . unwrap_or ( self . optimized_compiler_builtins )
1776- }
1777-
1778- pub fn optimized_compiler_builtins_path ( & self , target : TargetSelection ) -> Option < & str > {
1779- match self . target_config . get ( & target) ?. optimized_compiler_builtins . as_ref ( ) ? {
1780- StringOrBool :: String ( s) => Some ( s) ,
1781- StringOrBool :: Bool ( _) => None ,
1782- }
1777+ . unwrap_or ( & self . optimized_compiler_builtins )
17831778 }
17841779
17851780 pub fn llvm_enabled ( & self , target : TargetSelection ) -> bool {
0 commit comments