[LLVMbugs] [Bug 19390] New: [windows] Cmake llvm build of MinGW under Cygwin fails: Posix filesystem calls.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 9 15:16:41 PDT 2014


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: unassignedbugs at nondot.org
          Reporter: rfoos at codeaurora.org
                CC: llvmbugs at cs.uiuc.edu
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140409/e260839d/attachment.html>


More information about the llvm-bugs mailing list