@@ -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 ) ;
@@ -1763,19 +1766,11 @@ impl Config {
17631766 self . target_config . get ( & target) . and_then ( |t| t. rpath ) . unwrap_or ( self . rust_rpath )
17641767 }
17651768
1766- pub fn optimized_compiler_builtins ( & self , target : TargetSelection ) -> bool {
1769+ pub fn optimized_compiler_builtins ( & self , target : TargetSelection ) -> & CompilerBuiltins {
17671770 self . target_config
17681771 . get ( & target)
17691772 . and_then ( |t| t. optimized_compiler_builtins . as_ref ( ) )
1770- . map ( StringOrBool :: is_string_or_true)
1771- . unwrap_or ( self . optimized_compiler_builtins )
1772- }
1773-
1774- pub fn optimized_compiler_builtins_path ( & self , target : TargetSelection ) -> Option < & str > {
1775- match self . target_config . get ( & target) ?. optimized_compiler_builtins . as_ref ( ) ? {
1776- StringOrBool :: String ( s) => Some ( s) ,
1777- StringOrBool :: Bool ( _) => None ,
1778- }
1773+ . unwrap_or ( & self . optimized_compiler_builtins )
17791774 }
17801775
17811776 pub fn llvm_enabled ( & self , target : TargetSelection ) -> bool {
0 commit comments