From d780721c1044c60de3b996a0b444ef60324efe6b Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Tue, 6 Feb 2024 23:31:52 +0300 Subject: [PATCH] fix `llvm_out` to find the correct LLVM root When `download-ci-llvm` is enabled, llvm_out ends up with the error below due to an incorrect path on cross-compilations. This change fixes that. failed to execute command: "/rust/build/x86_64-unknown-linux-gnu/llvm/build/bin/llvm-config" "--version" ERROR: No such file or directory (os error 2) Signed-off-by: onur-ozkan --- src/bootstrap/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 1336abf6c7aba..1900827a92be7 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -801,7 +801,8 @@ impl Build { /// Note that if LLVM is configured externally then the directory returned /// will likely be empty. fn llvm_out(&self, target: TargetSelection) -> PathBuf { - self.out.join(&*target.triple).join("llvm") + let dir = if self.config.llvm_from_ci { "ci-llvm" } else { "llvm" }; + self.out.join(&*target.triple).join(dir) } fn lld_out(&self, target: TargetSelection) -> PathBuf {