[commit: ghc] master: Define MAP_ANONYMOUS on systems that only provide MAP_ANON (2689a16)

git at git.haskell.org git at git.haskell.org
Fri Dec 23 22:48:32 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2689a1692636521777f007861a484e7064b2d696/ghc

>---------------------------------------------------------------

commit 2689a1692636521777f007861a484e7064b2d696
Author: Gracjan Polak <gracjanpolak at gmail.com>
Date:   Fri Dec 23 14:37:08 2016 -0500

    Define MAP_ANONYMOUS on systems that only provide MAP_ANON
    
    Reviewers: simonmar, erikd, austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: gracjan, rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D2881
    
    GHC Trac Issues: #13005


>---------------------------------------------------------------

2689a1692636521777f007861a484e7064b2d696
 rts/LinkerInternals.h | 10 ++++++++++
 rts/linker/M32Alloc.h |  5 -----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h
index a09d079..76497df 100644
--- a/rts/LinkerInternals.h
+++ b/rts/LinkerInternals.h
@@ -12,6 +12,10 @@
 #include "Rts.h"
 #include "Hash.h"
 
+#if RTS_LINKER_USE_MMAP
+#include <sys/mman.h>
+#endif
+
 #include "BeginPrivate.h"
 
 typedef void SymbolAddr;
@@ -288,6 +292,12 @@ char *cstring_from_section_name(
     unsigned char* strtab);
 #endif /* mingw32_HOST_OS */
 
+/* MAP_ANONYMOUS is MAP_ANON on some systems,
+   e.g. OS X (before Sierra), OpenBSD etc */
+#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+
 /* Which object file format are we targetting? */
 #if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(freebsd_HOST_OS) || defined(kfreebsdgnu_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS) || defined(gnu_HOST_OS)
 #  define OBJFORMAT_ELF
diff --git a/rts/linker/M32Alloc.h b/rts/linker/M32Alloc.h
index db3d8c0..8ec49ca 100644
--- a/rts/linker/M32Alloc.h
+++ b/rts/linker/M32Alloc.h
@@ -19,11 +19,6 @@
 
 #endif
 
-/* MAP_ANONYMOUS is MAP_ANON on some systems, e.g. OS X, OpenBSD etc */
-#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
-#define MAP_ANONYMOUS MAP_ANON
-#endif
-
 #include "BeginPrivate.h"
 
 #if RTS_LINKER_USE_MMAP



More information about the ghc-commits mailing list