Fails to compile w/ MinGW: sys/mman.h: No such file or directory

I am having trouble getting LLVM/Clang to compile from SVN/trunk on win32
using MinGW (4.7.1). The error is:
sys/mman.h: No such file or directory
...and it happens during compilation of:
[LLVM/Clang]\projects\compiler-rt\lib\enable_execute_stack.c
I configured everything carefully as "CMAKE_BUILD_TYPE" "Release". I have in
the PATH (in that order):
- CMake
- MinGW
- Python 2.7.2
- ActivePerl
- Subversion 1.7.x
- GraphViz 2.3.0
All tools are found, configuration w/ Cmake succeeds hence that error. It
used to work like that when I compiled earlier, but that's roughly 4 month
ago. :-/

What can I do?

BTW: I think I posted this to the wrong mailing list in the first place, so
I repeat here (sorry for that):
(See reference:
http://llvm.1065342.n5.nabble.com/Fails-to-compile-w-MinGW-sys-mman-h-No-such-file-or-directory-tt53919.html)

What can I do?

Just don't build compiler-rt. And yes, instructions should be modified
to outline that compiler-rt is optional step.

Just don’t build compiler-rt. Oh well, as simple as that… I feel stupid now. Thanks for the help! Just out of curiosity: Why it used to work earlier? Is it included now by default or something like that? I don’t think I changed the CMake config too much in tat direction - but I’ll check… :wink:

Why is the header using sys/mman.h, isnt it supposed to be using llvm/Support include files such as MemoryBuffer ?

Thanks

Shankar Easwaran

I may be mistaken but I believe that compiler-rt cannot use
anything from llvm/ as it would introduce unwanted LLVM symbols
into compiler-rt.

Attached is something I came up with to fix the build on Windows,
not sure if it's correct as I couldn't figure out how to build the
tests on Windows.

Thanks,

compilerrt-fix-windows-build.patch (1.86 KB)