$OpenBSD: patch-js_src_jit_ProcessExecutableMemory_cpp,v 1.1 2019/10/07 13:43:06 kurt Exp $

Index: js/src/jit/ProcessExecutableMemory.cpp
--- js/src/jit/ProcessExecutableMemory.cpp.orig
+++ js/src/jit/ProcessExecutableMemory.cpp
@@ -318,6 +318,12 @@ static void DecommitPages(void* addr, size_t bytes) {
 }
 #else  // !XP_WIN
 static void* ComputeRandomAllocationAddress() {
+#ifdef __OpenBSD__
+  // OpenBSD already has random mmap and the idea that all x64 cpus
+  // have 48-bit address space is not correct. Returning nullptr
+  // allows OpenBSD do to the right thing.
+  return nullptr;
+#else
   uint64_t rand = js::GenerateRandomSeed();
 
 #  ifdef HAVE_64BIT_BUILD
@@ -337,6 +343,7 @@ static void* ComputeRandomAllocationAddress() {
   // Ensure page alignment.
   uintptr_t mask = ~uintptr_t(gc::SystemPageSize() - 1);
   return (void*)uintptr_t(rand & mask);
+#endif
 }
 
 static void* ReserveProcessExecutableMemory(size_t bytes) {
