disable large address space on OpenBSD
authorKarel Gardas <karel.gardas@centrum.cz>
Sat, 31 Oct 2015 22:16:53 +0000 (23:16 +0100)
committerKarel Gardas <karel.gardas@centrum.cz>
Sat, 31 Oct 2015 22:19:34 +0000 (23:19 +0100)
Summary:
This patch disables large address space on OpenBSD. The motivation
for this is that OpenBSD does not support MAP_NORESERVE. The flag is supported
only for source code compatibility reasons but is otherwise completely ignored
by the OS and its mmap syscall.

Reviewers: austin, bgamari

Subscribers: thomie, erikd

Differential Revision: https://phabricator.haskell.org/D1411

configure.ac

index 65e5d77..bc18c12 100644 (file)
@@ -1046,6 +1046,11 @@ if test "$ac_cv_sizeof_void_p" -eq 8 ; then
     if test "x$EnableLargeAddressSpace" = "xyes" ; then
         if test "$ghc_host_os" = "darwin" ; then
             use_large_address_space=yes
+       elif test "$ghc_host_os" = "openbsd" ; then
+           # as of OpenBSD 5.8 (2015), OpenBSD does not support mmap with MAP_NORESERVE.
+           # The flag MAP_NORESERVE is supported for source compatibility reasons,
+           # but is completely ignored by OS mmap
+            use_large_address_space=no
         else
             AC_CHECK_DECLS([MAP_NORESERVE, MADV_FREE, MADV_DONTNEED],[],[],
                 [