Merge pull request #187 from tevador/pr-netbsd

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:35:19 +02:00
committed by GitHub
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;
}