diff --git a/compiler/aarch64/runtime/VirtualGuardRuntime.cpp b/compiler/aarch64/runtime/VirtualGuardRuntime.cpp index 47b57751c48..692c5b6c958 100644 --- a/compiler/aarch64/runtime/VirtualGuardRuntime.cpp +++ b/compiler/aarch64/runtime/VirtualGuardRuntime.cpp @@ -26,6 +26,10 @@ #include "env/jittypes.h" #include +#if defined(OSX) +#include // for pthread_jit_write_protect_np +#endif + extern void arm64CodeSync(unsigned char *codeStart, unsigned int codeSize); extern "C" void _patchVirtualGuard(uint8_t *locationAddr, uint8_t *destinationAddr, int32_t smpFlag) diff --git a/compiler/codegen/OMRCodeGenerator.cpp b/compiler/codegen/OMRCodeGenerator.cpp index 5baaba7cda6..fc2c737d06d 100644 --- a/compiler/codegen/OMRCodeGenerator.cpp +++ b/compiler/codegen/OMRCodeGenerator.cpp @@ -112,6 +112,10 @@ #include "stdarg.h" #include "OMR/Bytes.hpp" +#if defined(OSX) && defined(AARCH64) +#include // for pthread_jit_write_protect_np +#endif + namespace TR { class Optimizer; } namespace TR { class RegisterDependencyConditions; } diff --git a/compiler/runtime/OMRCodeCache.cpp b/compiler/runtime/OMRCodeCache.cpp index 7806e080a9c..dabb230ac54 100644 --- a/compiler/runtime/OMRCodeCache.cpp +++ b/compiler/runtime/OMRCodeCache.cpp @@ -50,6 +50,10 @@ #include #endif +#if defined(OSX) && defined(AARCH64) +#include // for pthread_jit_write_protect_np +#endif + namespace TR { class CodeGenerator; } /***************************************************************************** diff --git a/compiler/runtime/OMRCodeCacheManager.cpp b/compiler/runtime/OMRCodeCacheManager.cpp index 563305fadf3..96b9962dba5 100644 --- a/compiler/runtime/OMRCodeCacheManager.cpp +++ b/compiler/runtime/OMRCodeCacheManager.cpp @@ -54,6 +54,10 @@ TR::CodeCacheSymbolContainer * OMR::CodeCacheManager::_symbolContainer = NULL; #endif //HOST_OS == OMR_LINUX +#if defined(OSX) && defined(AARCH64) +#include // for pthread_jit_write_protect_np +#endif + OMR::CodeCacheManager::CodeCacheManager(TR::RawAllocator rawAllocator) : _rawAllocator(rawAllocator), _initialized(false),