[commit: ghc] master: Don't use mmap symbols when !RTS_LINKER_USE_MMAP (a637eeb)
git at git.haskell.org
git at git.haskell.org
Wed Nov 16 04:08:51 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/a637eeb7a1852adfd99b06d2c0a3496e4f238a0c/ghc
>---------------------------------------------------------------
commit a637eeb7a1852adfd99b06d2c0a3496e4f238a0c
Author: Shea Levy <shea at shealevy.com>
Date: Tue Nov 15 22:01:20 2016 -0500
Don't use mmap symbols when !RTS_LINKER_USE_MMAP
Some usages of symbols from sys/mman.h are guarded by
RTS_LINKER_USE_MMAP by C conditionals, not CPP conditionals. Since those
branches are dead anyway when !RTS_LINKER_USE_MMAP, we just stub out the
relevant symbols rather than increasing CPP branching.
Fixes #12839.
Reviewers: simonmar, austin, bgamari, erikd
Reviewed By: simonmar, bgamari, erikd
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2710
GHC Trac Issues: #12839
>---------------------------------------------------------------
a637eeb7a1852adfd99b06d2c0a3496e4f238a0c
rts/LinkerInternals.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h
index 60370bb..4806d53 100644
--- a/rts/LinkerInternals.h
+++ b/rts/LinkerInternals.h
@@ -303,4 +303,14 @@ char *cstring_from_section_name(
# define OBJFORMAT_MACHO
#endif
+/* In order to simplify control flow a bit, some references to mmap-related
+ definitions are blocked off by a C-level if statement rather than a CPP-level
+ #if statement. Since those are dead branches when !RTS_LINKER_USE_MMAP, we
+ just stub out the relevant symbols here
+*/
+#if !RTS_LINKER_USE_MMAP
+#define munmap(x,y) /* nothing */
+#define MAP_ANONYMOUS 0
+#endif
+
#endif /* LINKERINTERNALS_H */
More information about the ghc-commits
mailing list