Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use crate::utils::build_stamp::{self, BuildStamp};
use crate::utils::channel::{self, Info};
use crate::utils::exec::{BootstrapCommand, command};
use crate::utils::helpers::{
exe, is_dylib, move_file, t, target_supports_cranelift_backend, timeit,
exe, is_dylib, libdir, move_file, t, target_supports_cranelift_backend, timeit,
};
use crate::utils::tarball::{GeneratedTarball, OverlayKind, Tarball};
use crate::{CodegenBackendKind, Compiler, DependencyType, FileType, LLVM_TOOLS, Mode, trace};
Expand Down Expand Up @@ -2533,7 +2533,7 @@ fn maybe_install_llvm(
),
)]
pub fn maybe_install_llvm_target(builder: &Builder<'_>, target: TargetSelection, sysroot: &Path) {
let dst_libdir = sysroot.join("lib/rustlib").join(target).join("lib");
let dst_libdir = sysroot.join("lib/rustlib").join(target).join(libdir(target));
// We do not need to copy LLVM files into the sysroot if it is not
// dynamically linked; it is already included into librustc_llvm
// statically.
Expand All @@ -2558,11 +2558,12 @@ pub fn maybe_install_llvm_target(builder: &Builder<'_>, target: TargetSelection,
)]
pub fn maybe_install_llvm_runtime(builder: &Builder<'_>, target: TargetSelection, sysroot: &Path) {
let dst_libdir = sysroot.join(builder.sysroot_libdir_relative(Compiler::new(1, target)));
let dst_runtime_libdir = dst_libdir.parent().unwrap().join(libdir(target));
// We do not need to copy LLVM files into the sysroot if it is not
// dynamically linked; it is already included into librustc_llvm
// statically.
if builder.llvm_link_shared() {
maybe_install_llvm(builder, target, &dst_libdir, false);
maybe_install_llvm(builder, target, &dst_runtime_libdir, false);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ impl Step for Enzyme {
let llvm_version_major = llvm::get_llvm_version_major(builder, &host_llvm_config);
let lib_ext = std::env::consts::DLL_EXTENSION;
let libenzyme = format!("libEnzyme-{llvm_version_major}");
let build_dir = out_dir.join("lib");
let build_dir = out_dir.join("bin");
let dylib = build_dir.join(&libenzyme).with_extension(lib_ext);

trace!("checking build stamp to see if we need to rebuild enzyme artifacts");
Expand Down Expand Up @@ -1203,6 +1203,7 @@ impl Step for Enzyme {
// At this point, `out_dir` should contain the built libEnzyme-<LLVM-version>.<dylib-ext>
// file.
if !dylib.exists() {
eprintln!("{} does not exist", dylib.display());
eprintln!(
"`{libenzyme}` not found in `{}`. Either the build has failed or Enzyme was built with a wrong version of LLVM",
build_dir.display()
Expand Down
4 changes: 4 additions & 0 deletions src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,8 @@ auto:
--target=aarch64-pc-windows-gnullvm,i686-pc-windows-gnullvm
--enable-full-tools
--enable-profiler
--enable-llvm-link-shared
--enable-llvm-enzyme
DIST_REQUIRE_ALL_TOOLS: 1
CODEGEN_BACKENDS: llvm,cranelift
CC_i686_pc_windows_gnullvm: i686-w64-mingw32-clang
Expand All @@ -703,6 +705,8 @@ auto:
--build=x86_64-pc-windows-gnullvm
--enable-full-tools
--enable-profiler
--enable-llvm-link-shared
--enable-llvm-enzyme
DIST_REQUIRE_ALL_TOOLS: 1
CODEGEN_BACKENDS: llvm,cranelift
<<: *job-windows
Expand Down
Loading