Repository navigation
Conversation
chess-oai
marked this pull request as ready for review
September 29, 2026 20:49
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.
Summary
rcodesigncurrently uses 4 KiB code-signature pages for every Mach-O. For large arm64 executables, this can make macOS signature verification slow: a 240 MB executable had 58,176 code slots at 4 KiB, compared with 14,544 at 16 KiB.In a profile of
codesign --verify --stricton the 4 KiB executable, 2,220 of 2,432 main-thread samples were inread(), underCodeDirectory::multipleHashFileData. Apple'sSecStaticCode::validateExecutableopens the executable withF_NOCACHEand hashes each code slot separately. The profile shows read-heavy validation; it does not establish the underlying cause of each read's latency.Add
--arm64-16k-code-pagesto opt arm64 Mach-O binaries into 16 KiB signature pages. The signer uses the selected size for both the code hashes and signature-size reservation. The 4 KiB default remains unchanged, as does the page size for other architectures. On the test machine, Apple'scodesignalso used 16 KiB by default for this arm64 executable.On macOS 26.7, using ad hoc signed copies of the same executable, strict verification of fresh APFS clones took:
codesign, bundlercodesign, standalone executableEach comparison used two runs per page size, in 4 KiB, 16 KiB, 16 KiB, 4 KiB order. The ad hoc
rcodesigncode directory shrank from approximately 1.86 MB to 0.47 MB. All 85 existing library tests pass with PKCS#11 enabled.