Repository navigation
Mac signing: add hardened-runtime entitlements so the JVM can launch - #4
Merged
Merged
Conversation
Hardened runtime without entitlements makes the bundled JVM crash at launch (EXC_BREAKPOINT in pthread_jit_write_protect_np). Add scripts/macos/arborj.entitlements (allow-jit, allow-unsigned-executable-memory, disable-library-validation for JavaFX natives extracted to ~/.openjfx/cache) and pass it when signing runtime executables, the Contents/MacOS launcher and the app bundle.
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.
scripts/sign-and-notarize-mac.shsigned the app with--options runtimebut no entitlements, so the bundled JDK 25 JVM crashed at launch (EXC_BREAKPOINT inpthread_jit_write_protect_npfromJNI_CreateJavaVM). Builds still passed codesign, spctl and notarization, so the failure only showed up when the app was launched.Changes
scripts/macos/arborj.entitlements:com.apple.security.cs.allow-jit: HotSpot JITcom.apple.security.cs.allow-unsigned-executable-memory: HotSpot code cachecom.apple.security.cs.disable-library-validation: JavaFX extractslibprism_es2.dylibetc. to~/.openjfx/cacheand loads them at runtime. Without this the app fails with "No toolkit found".sign-and-notarize-mac.sh: resolves the plist relative to the script and fails fast if it's missing. It passes--entitlementswhen signing the runtime executables,Contents/MacOS, and the outer.app. Plain dylibs and the runtime bundle stay unentitled.Verification
mvn clean package -Ppackage-macon JDK 25.0.5, then the committed script.Contents/MacOS/ArborJ.codesign --verify --deep --strictpasses.spctlreports Notarized Developer ID.Follow-up (not in this PR):
disable-library-validationrelaxes protection against library injection, because JavaFX loads its natives from a user-writable cache. Shipping the JavaFX natives signed inside the bundle would let library validation stay on. That's a packaging change and is tracked separately.