Detect if we have valid pthread_jit_write_protect_np
This commit is contained in:
parent
67deee7771
commit
4245475514
29
qemu/configure
vendored
29
qemu/configure
vendored
@ -2139,13 +2139,40 @@ fi
|
||||
if [ "$darwin" = "yes" ] ; then
|
||||
cat > $TMPC << EOF
|
||||
#include <pthread.h>
|
||||
int main() { pthread_jit_write_protect_np(0); return 0; }
|
||||
int main() { pthread_jit_write_protect_np(0); return 0;}
|
||||
EOF
|
||||
if ! compile_prog ""; then
|
||||
have_pthread_jit_protect='no'
|
||||
else
|
||||
have_pthread_jit_protect='yes'
|
||||
fi
|
||||
|
||||
if test "$have_pthread_jit_protect" = "yes" ; then
|
||||
cat > $TMPC << EOF
|
||||
#include "stdint.h"
|
||||
int main() {
|
||||
uint64_t commpage_sprr = (*(uint64_t*)0xFFFFFC10C);
|
||||
|
||||
// In Apple Hypervisor, this value is not accessbile and
|
||||
// pthread_jit_write_protect_np essentially is a no-op
|
||||
if (!commpage_sprr) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
if ! compile_prog ""; then
|
||||
have_pthread_jit_protect='no'
|
||||
else
|
||||
$TMPE
|
||||
if [ $? -eq 0 ]; then
|
||||
have_pthread_jit_protect='yes'
|
||||
else
|
||||
have_pthread_jit_protect='no'
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
##########################################
|
||||
|
Loading…
Reference in New Issue
Block a user