Fix compilation and JIT support on NetBSD:

1. Disable hugepages (not supported).
2. Force W^X (required).
3. When allocating JIT memory, PROT_EXEC must be reserved
   in order to set the pages executable later.
This commit is contained in:
tevador
2020-06-28 16:16:20 +02:00
parent 7741eb1e97
commit 708a4e50c5
6 changed files with 21 additions and 11 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ extern "C" {
randomx_flags randomx_get_flags() {
randomx_flags flags = RANDOMX_HAVE_COMPILER ? RANDOMX_FLAG_JIT : RANDOMX_FLAG_DEFAULT;
randomx::Cpu cpu;
#ifdef __OpenBSD__
#ifdef RANDOMX_FORCE_SECURE
if (flags == RANDOMX_FLAG_JIT) {
flags |= RANDOMX_FLAG_SECURE;
}