-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ios/tvos] ARM64 simulator JIT Hack and CMAKE_SYSTEM_VARIANT iOSSimulator #52764
[ios/tvos] ARM64 simulator JIT Hack and CMAKE_SYSTEM_VARIANT iOSSimulator #52764
Conversation
/cc @steveisok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repeated reversions are confusing: can you just give me a quick description of what configurations require the hack and why?
On iossimulator-arm64 and tvossimulator-arm64, use the pthread_jit_write_protect_np function to toggle the W^X bit for the current thread. Unfortunately, the above function is marked as __API_UNAVAILABLE on ios, tvos, watchos in the apple headers. But in the simulator frameworks it is still present and usable. So we declare our own prototype of the function and avoid the clang error. --- This reverts commit 89a816f, but for IOS simulator, not for Catalyst. That commit in turn reverted a9f1207 (ie this current commit is the same as a9f1207 but for ios simulator instead of catalyst)
For Mono, set HOST_DARWIN_SIMULATOR in cmake and C
53de876
to
b2153bf
Compare
Updated the commit message and the PR description. We're only enabling this for iossimulator-arm64 and tvossimulator-arm64. The reasoning being is that those are meant to run just on the local development machine, so there is no risk of running afoul of any App Store rules. |
apparently it wants to see literally `if (__builtin_available(...))`
We don't need this anymore. #53197 added a no-exec mode to the code manager so that cross-compilers don't need to use the pthread write_protect function. And #51536 will use the "JustInterp" ( |
On iossimulator-arm64 and tvossimulator-arm64, use the
pthread_jit_write_protect_np
function to toggle the W^X bit for the current thread.Unfortunately, the above function is marked as
__API_UNAVAILABLE
on ios, tvos, watchos in the apple headers. But in the simulator frameworks it is still present and usable. So we declare our own prototype of the function and avoid the clang error.This reverts commit 89a816f, but for iOS and tvOS simulators, not for Catalyst.
That commit in turn reverted a9f1207
(ie this current commit is the same as a9f1207 but for ios simulator instead of catalyst)
Build system changes:
Set
CMAKE_SYSTEM_VARIANT
to "iOSSimulator" or "tvOSSimulator".In Mono, set
CMAKE_DARWIN_SIMULATOR