File tree 1 file changed +28
-1
lines changed
1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -2139,13 +2139,40 @@ fi
2139
2139
if [ " $darwin " = " yes" ] ; then
2140
2140
cat > $TMPC << EOF
2141
2141
#include <pthread.h>
2142
- int main() { pthread_jit_write_protect_np(0); return 0; }
2142
+ int main() { pthread_jit_write_protect_np(0); return 0;}
2143
2143
EOF
2144
2144
if ! compile_prog " " ; then
2145
2145
have_pthread_jit_protect=' no'
2146
2146
else
2147
2147
have_pthread_jit_protect=' yes'
2148
2148
fi
2149
+
2150
+ if test " $have_pthread_jit_protect " = " yes" ; then
2151
+ cat > $TMPC << EOF
2152
+ #include "stdint.h"
2153
+ int main() {
2154
+ uint64_t commpage_sprr = (*(uint64_t*)0xFFFFFC10C);
2155
+
2156
+ // In Apple Hypervisor, this value is not accessbile and
2157
+ // pthread_jit_write_protect_np essentially is a no-op
2158
+ if (!commpage_sprr) {
2159
+ return 1;
2160
+ } else {
2161
+ return 0;
2162
+ }
2163
+ }
2164
+ EOF
2165
+ if ! compile_prog " " ; then
2166
+ have_pthread_jit_protect=' no'
2167
+ else
2168
+ $TMPE
2169
+ if [ $? -eq 0 ]; then
2170
+ have_pthread_jit_protect=' yes'
2171
+ else
2172
+ have_pthread_jit_protect=' no'
2173
+ fi
2174
+ fi
2175
+ fi
2149
2176
fi
2150
2177
2151
2178
# #########################################
You can’t perform that action at this time.
0 commit comments