Skip to content

Commit

Permalink
fix llvm_out to find the correct LLVM root
Browse files Browse the repository at this point in the history
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 <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Feb 6, 2024
1 parent 4a2fe44 commit d780721
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d780721

Please sign in to comment.