@@ -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,
@@ -123,7 +123,7 @@ pub struct Config {
123123 pub stage0_metadata : build_helper:: stage0_parser:: Stage0 ,
124124 pub android_ndk : Option < PathBuf > ,
125125 /// Whether to use the `c` feature of the `compiler_builtins` crate.
126- pub optimized_compiler_builtins : bool ,
126+ pub optimized_compiler_builtins : CompilerBuiltins ,
127127
128128 pub stdout_is_tty : bool ,
129129 pub stderr_is_tty : bool ,
@@ -1317,7 +1317,11 @@ impl Config {
13171317 }
13181318
13191319 config. optimized_compiler_builtins =
1320- build_optimized_compiler_builtins. unwrap_or ( config. channel != "dev" ) ;
1320+ build_optimized_compiler_builtins. unwrap_or ( if config. channel == "dev" {
1321+ CompilerBuiltins :: RustBuiltins
1322+ } else {
1323+ CompilerBuiltins :: BuildLLVMBuiltins
1324+ } ) ;
13211325 config. compiletest_diff_tool = build_compiletest_diff_tool;
13221326 config. compiletest_use_stage0_libtest =
13231327 build_compiletest_use_stage0_libtest. unwrap_or ( true ) ;
@@ -1763,19 +1767,11 @@ impl Config {
17631767 self . target_config . get ( & target) . and_then ( |t| t. rpath ) . unwrap_or ( self . rust_rpath )
17641768 }
17651769
1766- pub fn optimized_compiler_builtins ( & self , target : TargetSelection ) -> bool {
1770+ pub fn optimized_compiler_builtins ( & self , target : TargetSelection ) -> & CompilerBuiltins {
17671771 self . target_config
17681772 . get ( & target)
17691773 . 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- }
1774+ . unwrap_or ( & self . optimized_compiler_builtins )
17791775 }
17801776
17811777 pub fn llvm_enabled ( & self , target : TargetSelection ) -> bool {
0 commit comments