@@ -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 ) ;
@@ -1763,19 +1766,11 @@ impl Config {
1763
1766
self . target_config . get ( & target) . and_then ( |t| t. rpath ) . unwrap_or ( self . rust_rpath )
1764
1767
}
1765
1768
1766
- pub fn optimized_compiler_builtins ( & self , target : TargetSelection ) -> bool {
1769
+ pub fn optimized_compiler_builtins ( & self , target : TargetSelection ) -> & CompilerBuiltins {
1767
1770
self . target_config
1768
1771
. get ( & target)
1769
1772
. 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 )
1779
1774
}
1780
1775
1781
1776
pub fn llvm_enabled ( & self , target : TargetSelection ) -> bool {
0 commit comments