diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index dba95231338c..2e1edf81747e 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -458,20 +458,13 @@ pub fn std_crates_for_run_make(run: &RunConfig<'_>) -> Vec { /// Tries to find LLVM's `compiler-rt` source directory, for building `library/profiler_builtins`. /// -/// Normally it lives in the `src/llvm-project` submodule, but if that submodule -/// is absent and we have downloaded a copy of CI LLVM, then we try to use the -/// `compiler-rt` sources from there instead, which lets us avoid checking out -/// the LLVM submodule. +/// Normally it lives in the `src/llvm-project` submodule, but if we will be using a +/// downloaded copy of CI LLVM, then we try to use the `compiler-rt` sources from +/// there instead, which lets us avoid checking out the LLVM submodule. fn compiler_rt_for_profiler(builder: &Builder<'_>) -> PathBuf { - // If the LLVM submodule is already active, just update it and use that. - builder.update_existing_submodule("src/llvm-project"); - let submodule_compiler_rt = builder.src.join("src/llvm-project/compiler-rt"); - if submodule_compiler_rt.exists() { - return submodule_compiler_rt; - } - // Try to use `compiler-rt` sources from downloaded CI LLVM, if possible. if builder.config.llvm_from_ci { + builder.config.maybe_download_ci_llvm(); let ci_llvm_compiler_rt = builder.config.ci_llvm_root().join("compiler-rt"); if ci_llvm_compiler_rt.exists() { return ci_llvm_compiler_rt; @@ -482,7 +475,7 @@ fn compiler_rt_for_profiler(builder: &Builder<'_>) -> PathBuf { builder.require_submodule("src/llvm-project", { Some("The `build.profiler` config option requires `compiler-rt` sources from LLVM.") }); - submodule_compiler_rt + builder.src.join("src/llvm-project/compiler-rt") } /// Configure cargo to compile the standard library, adding appropriate env vars