Repository navigation
fix: strip at link time on macOS to keep arm64 signatures valid - #2000
klaustopher wants to merge 1 commit into
Conversation
CPack's strip step runs after linking and invalidates the ad-hoc signature the linker adds to arm64 binaries. The cctools strip in the osxcross image doesn't re-sign, so the arm64 slices of the universal nightly are rejected by macOS. Strip via linker flags instead and disable CPACK_STRIP_FILES on Apple. Fixes Return-To-The-Roots#1998
|
I would prefer fixing cctools strip instead of changing too much in some other places. I will have a look in the next days. Biggest issue is that I do not have access to an apple silicon device |
|
Also fine with this. Let me know if you need any verification on Apple Silicon Mac hardware |
|
Yes, I will tell you as soon as I have news to that. Thank you |
|
superseded by fc68502 Since we also use I've added it in a way that it should support native |
|
I‘ll take a look at tomorrows nightly |
|
I've created a new nightly deployment, should be up any second. (broken signatures in an updater is always bad :-)) |
|
Thanks! The arm64 slices of nightly Gatekeeper still rejects the downloaded bundle, though. I tested on a copy of the nightly: With slight modifications (moving With the current layout, it all gets broken already by the RTTR data in So for a real runnable
Detailed output:Running apple's codesign verification: Same results for:
But those are failing: Same for the bundled Running the gatekeeper check: |
Fixes #1998
CPack's strip step (
CPACK_STRIP_FILES) runsstrip -u -rafter linking, which invalidates the ad-hoc signature the linker adds to arm64 binaries. Apple'sstripre-signs, the cctools port in the osxcross image doesn't, so the arm64 slices of the universal nightly are rejected by macOS ("app is damaged").This strips at link time instead (
-Wl,-x -Wl,-Sfor Release), so the linker signs the already stripped binary, and disablesCPACK_STRIP_FILESon Apple. No new tools needed in the docker image.Tested natively on arm64 (Release,
RTTR_BUNDLE=ON):s25client,s25edit,starterand both drivers passcodesign -v --strict.Not tested inside the
apple-dockerimage, so it would be great if the next nightly could be checked withcodesign --verify -von the arm64 slice, I can also do that if you don't have access to a mac.