This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit d1f7fb3
committed
Auto merge of rust-lang#138250 - jieyouxu:ios-mitigation, r=<try>
Use `/usr/bin/strip` on macOS -> iOS cross as a temporary workaround
Crude workaround for <rust-lang#138212> to unblock nightly macOS-to-iOS cross builds. This reintroduces the "hard-coded strip" workaround (but only for iOS) that was initially introduced in rust-lang#130781.
Looks like LLVM 20's initial `llvm-objcopy` version that we ship as `rust-objcopy` may be producing stripped iOS binaries with invalid offsets that fail iOS platform consistency checks.
For the time being, use macOS system strip when cross-compiling from macOS -> iOS at `/usr/bin/strip` which should be available (unlike Linux -> macOS cross where this is not guaranteed to be available, partially why we are shipping `llvm-objcopy` in the first place[^linux-darwin-cross]) that shouldn't have this offset problem.
### Alternatives
- We *could* also try to use a `strip` from PATH. *However*, that can regress iOS users if they have broken homebrew binutils strip in their PATH that take precedence over a "good" strip.
- We could also wait for upstream `llvm-objcopy` fixes.
### Review and testing advice
I don't have access to either macOS or iOS platforms, and I can't really write a test for this. This will need to be tested manually.
r? `@davidtwco` (or reroll)
cc *-apple-ios target maintainers `@badboy` `@deg4uss3r` `@madsmtm`
try-job: dist-apple-various
try-job: dist-x86_64-apple
try-job: dist-aarch64-apple
[^linux-darwin-cross]: rust-lang#1312061 file changed
+12
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1046 | 1046 | | |
1047 | 1047 | | |
1048 | 1048 | | |
1049 | | - | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
1050 | 1061 | | |
1051 | 1062 | | |
1052 | 1063 | | |
| |||
0 commit comments