Post

Replies

Boosts

Views

Activity

Looks like the signed app losing entitlements
We would like to codesign up for the app that uses LuaJIT to be downloadable as the app with the identified developer on Apple silicon macOS. It means no targeting to the App Store which can be problematic due to LuaJIT usage. Looks like there is no problem making the application run with the signature, but the performance is really bad. All times are for running on an M2 chip, MacOS Sonoma 14.6. Our x86_64 build works fine. Reference LuaJIT benchmark takes around 0.15 seconds (seed 2, 100 runs). Same build for arm64 with ad-hoc signature, no entitlements, and needs around 1.8 seconds (seed 2, 100 runs) to run the same benchmark code. I created luajit_app in Xcode to investigate. It simply opens a window, you select Lua script, and it runs it and prints output to the text area. Signed by my developer ID, run from Xcode immediately after build: I see the same behaviors for the x86_64 build. It needs around 0.43 seconds (seed 2, 1000 runs) to finish the benchmark code. The arm64 build without added entitlements needs around 16 seconds (seed 2, 1000 runs). Added entitlements com.apple.security.cs.disable-executable-page-protection: The arm64 build typically needs around 0.14 seconds (seed 2, 1000 runs). Added entitlements com.apple.security.cs.allow-jit which fixed LuaJIT to use MAP_JIT flag: The arm64 build typically needs around 0.14 seconds (seed 2, 1000 runs). 2nd and other app runs need around 19 seconds for benchmark. Ad-hoc signed without developer ID and team, com.apple.security.cs.allow-jit: Run from Xcode The first app runs after the build/rebuild The arm64 build typically needs around 0.14 seconds (seed 2, 1000 runs), but the first run sometimes takes around 5 seconds (seed 2, 1000 runs). 2nd and next runs of the app The arm64 build typically needs around 19 seconds (seed 2, 1000 runs). Bad signed, signature fix from the command line: Signed with codesign --force --deep --sign MYID -o runtime --entitlements entitlements.plist luajit_app_bad_sign.app or AD-HOC Behaviors are similar to Xcode runs. The first time the app runs usually takes around 5 seconds and 0.14 seconds later for benchmark script. Sometimes first benchmark runs takes 5 seconds, the second run 19 seconds and later runs take 0.14 seconds. Later app runs typically fall to 19 seconds needed to do benchmark script. End I have also tried ad-hoc and the developer signature with both entitlements for the origin app, but no difference in time needs for the benchmark was observed. Any ideas what is going on?
6
0
359
Sep ’24