http://llvm.org/bugs/show_bug.cgi?id=19390

            Bug ID: 19390
           Summary: [windows] Cmake llvm build of MinGW under Cygwin
                    fails: Posix filesystem calls.
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

A CMake build using MinGW under CYGWIN fails in FileSystem.h. This is due to
the LLVM source code using Posix filesystem calls when LLVM_ON_UNIX is true.

Since MinGW can be used on both Cygwin/Unix, and Windows there is a conflict.
LLVM assumes that LLVM_ON_UNIX means that all posix filesystem calls are
present.

Since Mingw doesn't support posix filesystem calls, the build breaks early in:

    include/llvm/Support/FileSystem.h

The information to identify this case is in CMakeCCompiler.cmake.

The final definition of the flags is in LLVMConfig.cmake

    set(LLVM_ON_UNIX 1)
    set(LLVM_ON_WIN32 0)

For MinGW, LLVM_ON_UNIX must be false and LLVM_ON_WIN32 must be true.

Linux or Windows is not quite correct for this case. A new HAVE_POSIX,
segragating the filesystem headers and api's would be more correct. This is a
bit more extensive involving source code, cmake build, and autoconf build.

Since mingw current builds with LLVM_ON_WIN32 set this way, the trivial change
should work.

The Host and Compiler information regarding Cygwin and MinGW are all present in
CMakeCCompiler.cmake for a starting point. 

The variables needed by the build are set in LLVMConfig.cmake.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to