Skip to content

Commit d0200cd

Browse files
committed
!! (WIP) how about this?
1 parent 5b07169 commit d0200cd

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/bootstrap/src/core/build_steps/compile.rs

+5-12
Original file line numberDiff line numberDiff line change
@@ -458,20 +458,13 @@ pub fn std_crates_for_run_make(run: &RunConfig<'_>) -> Vec<String> {
458458

459459
/// Tries to find LLVM's `compiler-rt` source directory, for building `library/profiler_builtins`.
460460
///
461-
/// Normally it lives in the `src/llvm-project` submodule, but if that submodule
462-
/// is absent and we have downloaded a copy of CI LLVM, then we try to use the
463-
/// `compiler-rt` sources from there instead, which lets us avoid checking out
464-
/// the LLVM submodule.
461+
/// Normally it lives in the `src/llvm-project` submodule, but if we will be using a
462+
/// downloaded copy of CI LLVM, then we try to use the `compiler-rt` sources from
463+
/// there instead, which lets us avoid checking out the LLVM submodule.
465464
fn compiler_rt_for_profiler(builder: &Builder<'_>) -> PathBuf {
466-
// If the LLVM submodule is already active, just update it and use that.
467-
builder.update_existing_submodule("src/llvm-project");
468-
let submodule_compiler_rt = builder.src.join("src/llvm-project/compiler-rt");
469-
if submodule_compiler_rt.exists() {
470-
return submodule_compiler_rt;
471-
}
472-
473465
// Try to use `compiler-rt` sources from downloaded CI LLVM, if possible.
474466
if builder.config.llvm_from_ci {
467+
builder.config.maybe_download_ci_llvm();
475468
let ci_llvm_compiler_rt = builder.config.ci_llvm_root().join("compiler-rt");
476469
if ci_llvm_compiler_rt.exists() {
477470
return ci_llvm_compiler_rt;
@@ -482,7 +475,7 @@ fn compiler_rt_for_profiler(builder: &Builder<'_>) -> PathBuf {
482475
builder.require_submodule("src/llvm-project", {
483476
Some("The `build.profiler` config option requires `compiler-rt` sources from LLVM.")
484477
});
485-
submodule_compiler_rt
478+
builder.src.join("src/llvm-project/compiler-rt")
486479
}
487480

488481
/// Configure cargo to compile the standard library, adding appropriate env vars

0 commit comments

Comments
 (0)