Skip to content

Commit

Permalink
further fixes for macos (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZuseZ4 authored Aug 4, 2024
1 parent 512c484 commit 5f32db6
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1648,12 +1648,18 @@ impl Step for Assemble {
};

if let Some(enzyme_install) = enzyme_install {
let src_lib = enzyme_install.join("build/Enzyme/libEnzyme-17.so");
let lib_ext = match env::consts::OS {
"macos" => "dylib",
"windows" => "dll",
_ => "so",
};

let src_lib = enzyme_install.join("build/Enzyme/libEnzyme-17").with_extension(lib_ext);

let libdir = builder.sysroot_libdir(build_compiler, build_compiler.host);
let target_libdir = builder.sysroot_libdir(target_compiler, target_compiler.host);
let dst_lib = libdir.join("libEnzyme-17.so");
let target_dst_lib = target_libdir.join("libEnzyme-17.so");
let dst_lib = libdir.join("libEnzyme-17").with_extension(lib_ext);
let target_dst_lib = target_libdir.join("libEnzyme-17").with_extension(lib_ext);
builder.copy(&src_lib, &dst_lib);
builder.copy(&src_lib, &target_dst_lib);
}
Expand All @@ -1665,9 +1671,10 @@ impl Step for Assemble {
// when not performing a full bootstrap).
builder.ensure(Rustc::new(build_compiler, target_compiler.host));

// FIXME: For now patch over problems noted in #90244 by early returning here, even though
// we've not properly assembled the target sysroot. A full fix is pending further investigation,
// for now full bootstrap usage is rare enough that this is OK.
// FIXME: For now patch over problems noted in #90244 by early returning
// here, even though we've not properly assembled the target sysroot. A
// full fix is pending further investigation, for now full bootstrap
// usage is rare enough that this is OK.
if target_compiler.stage >= 3 && !builder.config.full_bootstrap {
return target_compiler;
}
Expand All @@ -1686,9 +1693,8 @@ impl Step for Assemble {

let lld_install = if builder.config.lld_enabled {
Some(builder.ensure(llvm::Lld { target: target_compiler.host }))
} else {
None
};
}
else {None};

let stage = target_compiler.stage;
let host = target_compiler.host;
Expand Down

0 comments on commit 5f32db6

Please sign in to comment.