From e1e736b2a3fb1322a34387d251aa1a78f81be78b Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Thu, 28 Jul 2022 21:40:33 +0200 Subject: [PATCH] Clone the `src/llvm-project` submodule if profiling is enabled To compile rustc with profiling information, `compiler-rt` from LLVM is required. Building it requires the `src/llvm-project` submodule to be initialized and updated. --- src/bootstrap/compile.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index aa7cda46bda..dd2b9d59366 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -111,6 +111,11 @@ impl Step for Std { builder.update_submodule(&Path::new("library").join("stdarch")); + // Profiler information requires LLVM's compiler-rt + if builder.config.profiler { + builder.update_submodule(&Path::new("src/llvm-project")); + } + let mut target_deps = builder.ensure(StartupObjects { compiler, target }); let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);