summaryrefslogtreecommitdiff
path: root/rts/LinkerInternals.h
diff options
context:
space:
mode:
Diffstat (limited to 'rts/LinkerInternals.h')
-rw-r--r--rts/LinkerInternals.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h
index a09d079758..76497df257 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