Skip to content

Commit

Permalink
!! (WIP) how about this?
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalathar committed Aug 24, 2024
1 parent 5b07169 commit 5e22431
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,20 +458,13 @@ pub fn std_crates_for_run_make(run: &RunConfig<'_>) -> Vec<String> {

/// 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;
Expand Down

0 comments on commit 5e22431

Please sign in to comment.