Skip to content

Commit 5f32db6

Browse files
authored
further fixes for macos (#153)
1 parent 512c484 commit 5f32db6

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/bootstrap/src/core/build_steps/compile.rs

+15-9
Original file line numberDiff line numberDiff line change
@@ -1648,12 +1648,18 @@ impl Step for Assemble {
16481648
};
16491649

16501650
if let Some(enzyme_install) = enzyme_install {
1651-
let src_lib = enzyme_install.join("build/Enzyme/libEnzyme-17.so");
1651+
let lib_ext = match env::consts::OS {
1652+
"macos" => "dylib",
1653+
"windows" => "dll",
1654+
_ => "so",
1655+
};
1656+
1657+
let src_lib = enzyme_install.join("build/Enzyme/libEnzyme-17").with_extension(lib_ext);
16521658

16531659
let libdir = builder.sysroot_libdir(build_compiler, build_compiler.host);
16541660
let target_libdir = builder.sysroot_libdir(target_compiler, target_compiler.host);
1655-
let dst_lib = libdir.join("libEnzyme-17.so");
1656-
let target_dst_lib = target_libdir.join("libEnzyme-17.so");
1661+
let dst_lib = libdir.join("libEnzyme-17").with_extension(lib_ext);
1662+
let target_dst_lib = target_libdir.join("libEnzyme-17").with_extension(lib_ext);
16571663
builder.copy(&src_lib, &dst_lib);
16581664
builder.copy(&src_lib, &target_dst_lib);
16591665
}
@@ -1665,9 +1671,10 @@ impl Step for Assemble {
16651671
// when not performing a full bootstrap).
16661672
builder.ensure(Rustc::new(build_compiler, target_compiler.host));
16671673

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

16871694
let lld_install = if builder.config.lld_enabled {
16881695
Some(builder.ensure(llvm::Lld { target: target_compiler.host }))
1689-
} else {
1690-
None
1691-
};
1696+
}
1697+
else {None};
16921698

16931699
let stage = target_compiler.stage;
16941700
let host = target_compiler.host;

0 commit comments

Comments
 (0)