[pcre-dev] [Bug 2769] r1315: apple_update_wx_flags() calls …

Page principale
Supprimer ce message
Auteur: admin
Date:  
À: pcre-dev
Sujet: [pcre-dev] [Bug 2769] r1315: apple_update_wx_flags() calls unavailable API when compiling to deploy on older macOS
https://bugs.exim.org/show_bug.cgi?id=2769

--- Comment #2 from Rich Siegel <siegel@???> ---
Calling an unavailable API is never a NOP. You'll get a runtime error from dyld
which ends up calling abort() on any OS which doesn't implement it. It looks
like this:

dyld: Symbol not found: _pthread_jit_write_protect_np
Referenced from: /path/to/app/executable
Expected in: /usr/lib/libSystem.B.dylib

If compiler compatibility is more than a theoretical issue, it should be
possible to further conditionalize the call as needed:

#ifdef __has_builtin
#if __has_builtin(builtin_available)
// do the work
#endif
#endif

If you're not compiling with a version of Xcode which includes a version of
clang which supports __builtin_availble(), it's a given that you can't call
pthread_jit_write_protect_np() because it won't exist in the SDK.

--
You are receiving this mail because:
You are on the CC list for the bug.