Browse Source

Merge branch 'dev' of https://git.hush.is/hush/hush3 into dev

dev-old-randomx
Duke 6 months ago
parent
commit
b0027d8c64
  1. 2
      depends/packages/libcurl.mk
  2. 20
      src/RandomX/src/virtual_memory.c

2
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

20
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

Loading…
Cancel
Save