@@ -47,8 +47,8 @@ use crate::core::config::toml::rust::{
47
47
} ;
48
48
use crate :: core:: config:: toml:: target:: Target ;
49
49
use 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,
52
52
} ;
53
53
use crate :: core:: download:: {
54
54
DownloadContext , download_beta_toolchain, is_download_ci_available, maybe_download_rustfmt,
@@ -122,8 +122,7 @@ pub struct Config {
122
122
pub patch_binaries_for_nix : Option < bool > ,
123
123
pub stage0_metadata : build_helper:: stage0_parser:: Stage0 ,
124
124
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 ,
127
126
128
127
pub stdout_is_tty : bool ,
129
128
pub stderr_is_tty : bool ,
@@ -1317,7 +1316,11 @@ impl Config {
1317
1316
}
1318
1317
1319
1318
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
+ } ) ;
1321
1324
config. compiletest_diff_tool = build_compiletest_diff_tool;
1322
1325
config. compiletest_use_stage0_libtest =
1323
1326
build_compiletest_use_stage0_libtest. unwrap_or ( true ) ;
@@ -1767,19 +1770,11 @@ impl Config {
1767
1770
self . target_config . get ( & target) . and_then ( |t| t. rpath ) . unwrap_or ( self . rust_rpath )
1768
1771
}
1769
1772
1770
- pub fn optimized_compiler_builtins ( & self , target : TargetSelection ) -> bool {
1773
+ pub fn optimized_compiler_builtins ( & self , target : TargetSelection ) -> & CompilerBuiltins {
1771
1774
self . target_config
1772
1775
. get ( & target)
1773
1776
. 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 )
1783
1778
}
1784
1779
1785
1780
pub fn llvm_enabled ( & self , target : TargetSelection ) -> bool {
0 commit comments