rust-apple.yml / rust-osx.yml: post-link strip breaks the arm64 macOS code signature, so RetroArch is killed loading Rust cores
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- build-system, devops
Research direction
Read the rust-apple.yml and rust-osx.yml templates, especially the arm64 job variables and post-build strip commands. Compare the confirmed STRIP_CORE_LIB: "0" build result with the stripped artifact behavior; the report points to disabling stripping for arm64 macOS as a working fix. Done means the produced arm64 dylib verifies and loads in RetroArch without being killed.
Written by the indexing model from the issue text.
Description
Summary
The two Rust macOS templates strip the core after cargo build:
rust-apple.yml,.libretro-rust-apple-base:if [ "$STRIP_CORE_LIB" -eq 1 ]; then $STRIP -S ${CORENAME}_libretro.dylib; fi, withSTRIP_CORE_LIB: 1from.libretro-rust-apple-osx-baserust-osx.yml,.libretro-rust-osx-base:$STRIP --strip-unneeded ...withSTRIP_CORE_LIB: 1
For aarch64-apple-darwin, the linker has already ad-hoc signed the dylib (CodeDirectory flags 0x20002, adhoc + linker-signed). The image's strip ($AARCH64_DARWIN_STRIP, the osxcross cctools port running on Linux) rewrites the file and does not re-sign it. On Apple Silicon, macOS kills any process that maps arm64 code whose page hashes do not match its CodeDirectory. So RetroArch is SIGKILLed the moment it loads the core: it freezes and exits, with no error dialog.
Evidence
rustynes_libretro.dylib from nightly/apple/osx/arm64/latest/ (built 2026-10-20 05:14 UTC). We recomputed each 4 KiB page's SHA-256 and compared it with the CodeDirectory in LC_CODE_SIGNATURE:
| core | pages | mismatched | signed range ends at the signature |
|---|---|---|---|
| rustynes (rust-apple.yml) | 538 | 101 | no (codeLimit 2201840, signature at 2201872) |
| gambatte (osx-arm64.yml, native Mac runner) | 949 | 0 | yes |
| snes9x (osx-arm64.yml, native Mac runner) | 707 | 0 | yes |
The x86_64 cores are unaffected: an x86_64 dylib carries no signature and needs none.
Fix options
- Don't strip arm64 macOS cores (
STRIP_CORE_LIB: 0for.libretro-rust-osx-arm64-default). This is what RustyNES now does in its own.gitlab-ci.yml(job variables outrank the template). A release profile without debug info gives-Slittle to remove. - Re-sign after stripping, if the image has a signer:
rcodesign sign <dylib>(apple-codesign) orldid -S <dylib>. - Strip at link time (
-Wl,-S/-Wl,-xthroughRUSTFLAGS), so the linker signs the final bytes.
Any Rust core cross-built for aarch64-apple-darwin from these templates with stripping on is likely affected the same way. iOS/tvOS dylibs are re-signed when they are bundled into the App Store app, so this shows up on macOS through the Online Updater.
Confirmed on the buildbot with option 1: with STRIP_CORE_LIB: "0" on the arm64 job (doublegate/RustyNES#623), libretro's pipeline 125851 produced an arm64 dylib that verifies: 538 pages, 0 mismatched, codeLimit equal to the signature offset, flags 0x20002 (linker-signed). Separately, the pre-fix buildbot core, re-signed ad-hoc and changed in nothing else, loads in RetroArch on an M5 Max running macOS 27.0.1, where the unmodified file got RetroArch killed.
These templates live in libretro-infrastructure/ci-templates on git.libretro.com, whose issue tracker needs an account. This seemed the closest public place to report it. Please move it wherever it belongs.
- Dominant language
- Shell
- Stars
- 475
- Forks
- 355
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from libretro/libretro-super
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
libretro/libretro-super#2014 · 2 comments ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
libretro/libretro-super#2201 ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
libretro/libretro-super#2195 · 4 comments ·
Maintainers usually reply within 2 days
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
libretro/libretro-super#2121 · 3 comments ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
libretro/libretro-super#2120 · 1 comment ·
Maintainers usually reply within 2 days
All issues in libretro/libretro-super
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nolte/kamerplanter-appliance#32 ·
Maintainers usually reply within 1 day
-
research
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
slayerlabs/benchmarks-fabryka-ai#256 ·
Maintainers usually reply within 1 day
-
bug priority-medium to-agent
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ONLYOFFICE/DocumentServer#3917 ·