Backport #203680 and #205044#198
Merged
cuviper merged 2 commits intoJun 24, 2026
Merged
Conversation
…203680) Align Mach-O __LINKEDIT entries to the target pointer size when building the tail layout. This matches the behavior of ld64 and lld-macho. dyld on macOS 27 rejects loading dylibs with misaligned __LINKEDIT entries. See llvm#203678 for details and the motivation of this fix. AI Tool Use Disclosure: Regarding the PR and the linked issue, I have personally wrote every single part of the PR by myself, and have/ran/verified every single part of the issue report as well without any AI tool usage. I have used LLM-based coding agents only for debugging purposes, e.g. to figure out why the dylib was not loading (from the original bug report), and figuring out how to build, run, and test my local `llvm-objcopy`. (cherry picked from commit 18c1cbc)
…05044) This is a follow-up of PR llvm#203680 that added the test case `linkedit-alignment.test`, which currently fails on big-endian buildbots (see: https://lab.llvm.org/buildbot/#/builders/98/builds/3084 and https://lab.llvm.org/buildbot/#/builders/114/builds/906). The failure seems to be on `yaml2obj`, where `writeDynamicSymbolTable` emits an indirect symbol table in host byte order rather than the specified object's byte order (i.e. the `IsLittleEndian` field value). This PR adds the missing swap and a regression test that round-trips all endian-sensitive fields with both endianness values. (cherry picked from commit 6e56216)
Author
|
Pinging @nikic on getting this backport merged! Sorry if this is noise. |
Member
|
LGTM, thanks! |
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…lign-157750, r=cuviper Update LLVM for Mach-O __LINKEDIT alignment fix. Update LLVM submodule to pull in changes from rust-lang/llvm-project#198. Fixes rust-lang#157750. This backport has been discussed in: [#t-compiler > Backport LLVM change to Rust for macOS 27 support?](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Backport.20LLVM.20change.20to.20Rust.20for.20macOS.2027.20support.3F/with/605925959).
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Jun 25, 2026
…lign-157750, r=cuviper Update LLVM for Mach-O __LINKEDIT alignment fix. Update LLVM submodule to pull in changes from rust-lang/llvm-project#198. Fixes rust-lang#157750. This backport has been discussed in: [#t-compiler > Backport LLVM change to Rust for macOS 27 support?](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Backport.20LLVM.20change.20to.20Rust.20for.20macOS.2027.20support.3F/with/605925959).
rust-timer
added a commit
to rust-lang/rust
that referenced
this pull request
Jun 26, 2026
Rollup merge of #158410 - goranmoomin:update-llvm-linkedit-align-157750, r=cuviper Update LLVM for Mach-O __LINKEDIT alignment fix. Update LLVM submodule to pull in changes from rust-lang/llvm-project#198. Fixes #157750. This backport has been discussed in: [#t-compiler > Backport LLVM change to Rust for macOS 27 support?](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Backport.20LLVM.20change.20to.20Rust.20for.20macOS.2027.20support.3F/with/605925959).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a backport of llvm#203680 and llvm#205044 to address rust-lang/rust#157750.
This backport has been discussed in: #t-compiler > Backport LLVM change to Rust for macOS 27 support?.
All relevant LLVM PRs have been merged into main.