| author | bors <bors@rust-lang.org> 2026-03-28 04:26:48 UTC |
| committer | bors <bors@rust-lang.org> 2026-03-28 04:26:48 UTC |
| log | c4db0e127c6e96d1798423bf9f205fd06f5481a6 |
| tree | 1a7e2f7c5611ecb18393eab7b560426bc1c25313 |
| parent | e1613686e0efc80a1a18b1263625450a8de3fb04 |
| parent | 0d3d1ac9b3417fcea4fc2cb631779b32891c14d0 |
Revert "Link LLVM dynamically on aarch64-apple-darwin" and "re-enable enzyme/autodiff builds on dist-aarch64-apple"
This reverts commit e7c268f8837b2e67d1f90a75357a4c58f697dc59.
This approach was much better than the last time, as it didn't break downstream users like miri.
Unfortunately, it still broke rustc contributors and is blocking some people: https://github.com/rust-lang/rust/issues/154408
The previously discussed solution (symlink) didn't seem to work for a user, and shipping two full copies of LLVM (old + new name) until the next stage0 compiler bump should probably be discussed first. We now also have artifacts of a nightly or two, which can be used for local experimenting, so hopefully next time we won't break anyone at all.
cc @sgasho
r? @jieyouxu 4 files changed, 5 insertions(+), 20 deletions(-)
compiler/rustc_llvm/build.rs-10| ... | ... | @@ -402,16 +402,6 @@ fn main() { |
| 402 | 402 | continue; |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | // On apple-darwin, llvm-config reports the versioned shared library name such as LLVM-22-..., but | |
| 406 | // the distributed toolchain ships libLLVM.dylib. Normalize the link name here. | |
| 407 | let name = | |
| 408 | if target.contains("apple-darwin") && llvm_kind == "dylib" && name.starts_with("LLVM-") | |
| 409 | { | |
| 410 | "LLVM" | |
| 411 | } else { | |
| 412 | name | |
| 413 | }; | |
| 414 | ||
| 415 | 405 | let kind = if name.starts_with("LLVM") { |
| 416 | 406 | llvm_kind |
| 417 | 407 | } else if is_static { |
compiler/rustc_metadata/src/native_libs.rs+3-7| ... | ... | @@ -62,15 +62,12 @@ pub fn walk_native_lib_search_dirs<R>( |
| 62 | 62 | f(&sess.target_tlib_path.dir.join("self-contained"), false)?; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | let has_shared_llvm_apple_darwin = | |
| 66 | sess.target.is_like_darwin && sess.target_tlib_path.dir.join("libLLVM.dylib").exists(); | |
| 67 | ||
| 68 | 65 | // Toolchains for some targets may ship `libunwind.a`, but place it into the main sysroot |
| 69 | 66 | // library directory instead of the self-contained directories. |
| 70 | 67 | // Sanitizer libraries have the same issue and are also linked by name on Apple targets. |
| 71 | 68 | // The targets here should be in sync with `copy_third_party_objects` in bootstrap. |
| 72 | // On Apple targets, shared LLVM is linked by name, so when `libLLVM.dylib` is | |
| 73 | // present in the target libdir, add that directory to the linker search path. | |
| 69 | // Finally there is shared LLVM library, which unlike compiler libraries, is linked by the name, | |
| 70 | // therefore requiring the search path for the linker. | |
| 74 | 71 | // FIXME: implement `-Clink-self-contained=+/-unwind,+/-sanitizers`, move the shipped libunwind |
| 75 | 72 | // and sanitizers to self-contained directory, and stop adding this search path. |
| 76 | 73 | // FIXME: On AIX this also has the side-effect of making the list of library search paths |
| ... | ... | @@ -80,8 +77,7 @@ pub fn walk_native_lib_search_dirs<R>( |
| 80 | 77 | || sess.target.os == Os::Linux |
| 81 | 78 | || sess.target.os == Os::Fuchsia |
| 82 | 79 | || sess.target.is_like_aix |
| 83 | || sess.target.is_like_darwin | |
| 84 | && (!sess.sanitizers().is_empty() || has_shared_llvm_apple_darwin) | |
| 80 | || sess.target.is_like_darwin && !sess.sanitizers().is_empty() | |
| 85 | 81 | || sess.target.os == Os::Windows |
| 86 | 82 | && sess.target.env == Env::Gnu |
| 87 | 83 | && sess.target.cfg_abi == CfgAbi::Llvm |
src/bootstrap/download-ci-llvm-stamp+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | 1 | Change this file to make users of the `download-ci-llvm` configuration download |
| 2 | 2 | a new version of LLVM from CI, even if the LLVM submodule hasn’t changed. |
| 3 | 3 | |
| 4 | Last change is for: https://github.com/rust-lang/rust/pull/151063 | |
| 4 | Last change is for: https://github.com/rust-lang/rust/pull/154485 |
src/ci/github-actions/jobs.yml+1-2| ... | ... | @@ -509,7 +509,7 @@ auto: |
| 509 | 509 | - name: dist-aarch64-apple |
| 510 | 510 | env: |
| 511 | 511 | SCRIPT: >- |
| 512 | ./x.py dist bootstrap enzyme | |
| 512 | ./x.py dist bootstrap | |
| 513 | 513 | --include-default-paths |
| 514 | 514 | --host=aarch64-apple-darwin |
| 515 | 515 | --target=aarch64-apple-darwin |
| ... | ... | @@ -518,7 +518,6 @@ auto: |
| 518 | 518 | --enable-sanitizers |
| 519 | 519 | --enable-profiler |
| 520 | 520 | --set rust.jemalloc |
| 521 | --set llvm.link-shared=true | |
| 522 | 521 | --set rust.lto=thin |
| 523 | 522 | --set rust.codegen-units=1 |
| 524 | 523 | # Aarch64 tooling only needs to support macOS 11.0 and up as nothing else |