Skip to content

Commit de8fc81

Browse files
committed
macos: somehow allow building with a target below 11.0
While building for macOS older than 11 in Apple Silicon makes no sense, some build systems lack the flexibility to set a target per architecture while aiming to support multi architecture binaries. Allow an option in those cases by using the slower runtime checks if the toolchain allows it. Fixes: PCRE2Project/pcre2#109
1 parent 050215b commit de8fc81

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sljit_src/sljitExecAllocator.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ static SLJIT_INLINE void apple_update_wx_flags(sljit_s32 enable_exec)
152152
{
153153
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
154154
pthread_jit_write_protect_np(enable_exec);
155+
#elif defined(__clang__)
156+
if (__builtin_available(macOS 11.0, *))
157+
pthread_jit_write_protect_np(enable_exec);
155158
#else
156159
#error "Must target Big Sur or newer"
157160
#endif /* BigSur */

0 commit comments

Comments
 (0)