Skip to content
17 changes: 15 additions & 2 deletions src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,24 @@ impl Step for Llvm {
// This is an experimental flag, which likely builds more than necessary.
// We will optimize it when we get closer to releasing it on nightly.
if builder.config.llvm_offload {
//enabled_llvm_projects.push("lld");
enabled_llvm_runtimes.push("offload");
//FIXME(ZuseZ4): LLVM intends to drop the offload dependency on openmp.
//Remove this line once they achieved it.
enabled_llvm_runtimes.push("openmp");
enabled_llvm_projects.push("compiler-rt");
//enabled_llvm_runtimes.push("openmp");
//enabled_llvm_runtimes.push("compiler-rt");

// -DRUNTIMES_CMAKE_ARGS="-DLIBOMPTARGET_PLUGINS_TO_BUILD=amdgpu;nvptx;
//cfg.define("RUNTIMES_CMAKE_ARGS", "-DLIBOMPTARGET_PLUGINS_TO_BUILD=amdgpu;nvptx");
//cfg.define("LLVM_TARGETS_TO_BUILD", "host;AMDGPU;NVPTX");

//let runtime_targets = vec!["default", "amdgcn-amd-amdhsa", "nvptx64-nvidia-cuda"];
//cfg.define("LLVM_RUNTIME_TARGETS", runtime_targets.join(";"));

cfg.define("LLVM_INCLUDE_TESTS", "OFF");
cfg.define("LLVM_BUILD_TESTS", "OFF");
//cfg.define("RUNTIMES_nvptx64-nvidia-cuda_LLVM_ENABLE_RUNTIMES", "openmp");
//cfg.define("RUNTIMES_amdgcn-amd-amdhsa_LLVM_ENABLE_RUNTIMES", "openmp");
}

if !enabled_llvm_projects.is_empty() {
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ ENV RUST_CONFIGURE_ARGS \
--set target.x86_64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \
--set llvm.thin-lto=true \
--set llvm.ninja=false \
--set llvm.offload=true \
--set llvm.libzstd=true \
--set rust.jemalloc \
--set rust.bootstrap-override-lld=true \
Expand Down
Loading