Commit a637eeb7 authored by shlevy's avatar shlevy Committed by Ben Gamari

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
parent 4a835f08
......@@ -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 */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment