Skip to content

Commit 99e2a89

Browse files
committed
Auto merge of #151063 - sgasho:aarch64-dist-enzyme, r=<try>
Dist Enzyme for macOS with unversioned LLVM dylib try-job: dist-aarch64-apple
2 parents 9f0615c + 5ffae10 commit 99e2a89

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

compiler/rustc_llvm/build.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,14 @@ fn main() {
402402
continue;
403403
}
404404

405+
let name =
406+
if target.contains("apple-darwin") && llvm_kind == "dylib" && name.starts_with("LLVM-")
407+
{
408+
"LLVM"
409+
} else {
410+
name
411+
};
412+
405413
let kind = if name.starts_with("LLVM") {
406414
llvm_kind
407415
} else if is_static {

compiler/rustc_metadata/src/native_libs.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ pub fn walk_native_lib_search_dirs<R>(
5757
f(&sess.target_tlib_path.dir.join("self-contained"), false)?;
5858
}
5959

60+
let has_shared_llvm_apple_darwin =
61+
sess.target.is_like_darwin && sess.target_tlib_path.dir.join("libLLVM.dylib").exists();
62+
6063
// Toolchains for some targets may ship `libunwind.a`, but place it into the main sysroot
6164
// library directory instead of the self-contained directories.
6265
// Sanitizer libraries have the same issue and are also linked by name on Apple targets.
@@ -72,7 +75,8 @@ pub fn walk_native_lib_search_dirs<R>(
7275
|| sess.target.os == Os::Linux
7376
|| sess.target.os == Os::Fuchsia
7477
|| sess.target.is_like_aix
75-
|| sess.target.is_like_darwin && !sess.sanitizers().is_empty()
78+
|| sess.target.is_like_darwin
79+
&& (!sess.sanitizers().is_empty() || has_shared_llvm_apple_darwin)
7680
|| sess.target.os == Os::Windows
7781
&& sess.target.env == Env::Gnu
7882
&& sess.target.abi == Abi::Llvm

src/ci/github-actions/jobs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ auto:
484484
- name: dist-aarch64-apple
485485
env:
486486
SCRIPT: >-
487-
./x.py dist bootstrap
487+
./x.py dist bootstrap enzyme
488488
--include-default-paths
489489
--host=aarch64-apple-darwin
490490
--target=aarch64-apple-darwin
@@ -493,6 +493,7 @@ auto:
493493
--enable-sanitizers
494494
--enable-profiler
495495
--set rust.jemalloc
496+
--set llvm.link-shared=true
496497
--set rust.lto=thin
497498
--set rust.codegen-units=1
498499
# Aarch64 tooling only needs to support macOS 11.0 and up as nothing else

0 commit comments

Comments
 (0)