User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/76.0.3809.100 Chrome/76.0.3809.100 Safari/537.36
Steps to reproduce:
Build and use mozilla projects on OpenBSD/arm64.
Building x11/gnome/gjs failed in configure check of seamonkey.
ComputeRandomAllocationAddress() in js/src/jit/ProcessExecutableMemory.cpp makes broad assumptions about addressable memory. For 64 bit builds it assumes all cpus have 48-bit address space and uses 46-bits for its random calculation. For 32 bit builds it assumes [512MiB, 1.5GiB) is ideal.
On OpenBSD/arm64 the current addressable range is 38 bits. When mmap is provided an address hint greater than the addressable range it fails. Since OpenBSD already has random mmap when NULL is provided as the address hint, it makes sense to allow the kernel to select the random address. It removes incorrect assumptions about the addressable memory range and it allows the kernel to select a random address while attempting to reduce memory fragmentation.
Attached is a patch that makes ComputeRandomAllocationAddress() return nullptr on OpenBSD so that mmap gets NULL as hint address, enabling the kernel to select a random address.