From 19e18cf37a57f7d89330deb4d8ef36fe520ffc89 Mon Sep 17 00:00:00 2001 From: fekt Date: Thu, 30 Nov 2023 05:01:53 +0000 Subject: [PATCH 1/2] Temp Mac workaround --- src/RandomX/src/virtual_memory.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/RandomX/src/virtual_memory.c b/src/RandomX/src/virtual_memory.c index d2cdcda0f..9b06ad050 100644 --- a/src/RandomX/src/virtual_memory.c +++ b/src/RandomX/src/virtual_memory.c @@ -148,9 +148,9 @@ void* allocMemoryPages(size_t bytes) { mem = NULL; #if defined(USE_PTHREAD_JIT_WP) && defined(MAC_OS_VERSION_11_0) \ && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0 - if (__builtin_available(macOS 11.0, *)) { + //if (__builtin_available(macOS 11.0, *)) { pthread_jit_write_protect_np(0); - } + //} #endif #endif return mem; @@ -173,11 +173,11 @@ void setPagesRW(void* ptr, size_t bytes) { char *errfunc; #if defined(USE_PTHREAD_JIT_WP) && defined(MAC_OS_VERSION_11_0) \ && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0 - if (__builtin_available(macOS 11.0, *)) { + //if (__builtin_available(macOS 11.0, *)) { pthread_jit_write_protect_np(0); - } else { - pageProtect(ptr, bytes, PAGE_READWRITE, &errfunc); - } + //} else { + // pageProtect(ptr, bytes, PAGE_READWRITE, &errfunc); + //} #else pageProtect(ptr, bytes, PAGE_READWRITE, &errfunc); #endif @@ -187,12 +187,12 @@ void setPagesRX(void* ptr, size_t bytes) { char *errfunc; #if defined(USE_PTHREAD_JIT_WP) && defined(MAC_OS_VERSION_11_0) \ && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0 - if (__builtin_available(macOS 11.0, *)) { + //if (__builtin_available(macOS 11.0, *)) { pthread_jit_write_protect_np(1); __builtin___clear_cache((char*)ptr, ((char*)ptr) + bytes); - } else { - pageProtect(ptr, bytes, PAGE_EXECUTE_READ, &errfunc); - } + //} else { + // pageProtect(ptr, bytes, PAGE_EXECUTE_READ, &errfunc); + //} #else pageProtect(ptr, bytes, PAGE_EXECUTE_READ, &errfunc); #endif From bde07c25fe4b76c9eb24c36eb771032f38700fe4 Mon Sep 17 00:00:00 2001 From: fekt Date: Thu, 30 Nov 2023 05:30:50 +0000 Subject: [PATCH 2/2] Mac fix --- depends/packages/libcurl.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/libcurl.mk b/depends/packages/libcurl.mk index 92c319a70..96c41e0b5 100644 --- a/depends/packages/libcurl.mk +++ b/depends/packages/libcurl.mk @@ -14,7 +14,7 @@ $(package)_dependencies=wolfssl $(package)_download_path=https://curl.haxx.se/download $(package)_config_opts_linux=--disable-shared --enable-static --without-ssl --prefix=$(host_prefix) --host=$(host) $(package)_config_opts_mingw32=--enable-mingw --disable-shared --enable-static --with-wolfssl --without-ssl --prefix=$(host_prefix) --host=x86_64-w64-mingw32 -$(package)_config_opts_darwin=--disable-shared --enable-static --with-wolfssl --without-ssl --prefix=$(host_prefix) +$(package)_config_opts_darwin=--disable-shared --enable-static --without-ssl --prefix=$(host_prefix) $(package)_cflags_darwin=-mmacosx-version-min=10.9 $(package)_conf_tool=./configure