Skip to content

Commit

Permalink
fix prebuilt_llvm_config to use the correct LLVM root
Browse files Browse the repository at this point in the history
When `download-ci-llvm` is enabled, `prebuilt_llvm_config` 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 d3848dc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ pub fn prebuilt_llvm_config(
let root = "src/llvm-project/llvm";
let out_dir = builder.llvm_out(target);

let mut llvm_config_ret_dir = builder.llvm_out(builder.config.build);
let mut llvm_config_ret_dir = if builder.config.llvm_from_ci {
builder.config.ci_llvm_root()
} else {
builder.llvm_out(builder.config.build)
};

if !builder.config.build.is_msvc() || builder.ninja() {
llvm_config_ret_dir.push("build");
}
Expand Down

0 comments on commit d3848dc

Please sign in to comment.