這個問題與CMake無關。這是Ting使用的特殊MinGW tool chain中的一個錯誤。所有其他32位MinGW的工具鏈編譯LLVM - 3.4成功地與CMake的2.8.12.2,即使在64位Windows:
TDM-GCC
的MinGW-構建
贏-Builds
MSys2
MSys2甚至可以使用64位工具鏈進行編譯,只需使用pacman更新binutils並設置「CXXFLAGS = -Wa,-mbig-obj」即可。 (不幸的是,在撰寫本文時,沒有其他工具鏈的更新可用)。
順便說一句:即使您將llvm-3.0設爲「CXXFLAGS = -D_GLIBCXX_HAVE_FENV_H」到llvm-3.2,舊的MinGW工具鏈也會運行走入誤區(其它工具鏈會碰上其他錯誤):
llvm-3.0\llvm\tools\clang\lib\Basic\FileManager.cpp:290:66: error: no matching function for call to 'clang::FileManager::getStatValue(const char*&, _stat64i32&, int)'
llvm-3.0\llvm\tools\clang\lib\Basic\FileManager.cpp:358:61: error: no matching function for call to 'clang::FileManager::getStatValue(const char*&, _stat64i32&, int*)'
llvm-3.0\llvm\tools\clang\lib\Basic\FileManager.cpp:429:61: error: no matching function for call to 'clang::FileManager::getStatValue(const char*&, _stat64i32&, int*)'
llvm-3.0\llvm\tools\clang\lib\Basic\FileManager.cpp:539:6: error: prototype for 'bool clang::FileManager::getStatValue(const char*, _stat64i32&, int*)' does not match any in class 'clang::FileManager'
llvm-3.0\llvm\tools\clang\lib\Basic\FileManager.cpp:554:6: error: prototype for 'bool clang::FileManager::getNoncachedStatValue(llvm::StringRef, _stat64i32&)' does not match any in class 'clang::FileManager'
llvm-3.1\llvm\tools\clang\lib\Basic\FileManager.cpp:295:66: error: no matching function for call to 'clang::FileManager::getStatValue(const char*&, _stat64i32&, int)'
llvm-3.1\llvm\tools\clang\lib\Basic\FileManager.cpp:363:61: error: no matching function for call to 'clang::FileManager::getStatValue(const char*&, _stat64i32&, int*)'
llvm-3.1\llvm\tools\clang\lib\Basic\FileManager.cpp:434:61: error: no matching function for call to 'clang::FileManager::getStatValue(const char*&, _stat64i32&, int*)'
llvm-3.1\llvm\tools\clang\lib\Basic\FileManager.cpp:544:6: error: prototype for 'bool clang::FileManager::getStatValue(const char*, _stat64i32&, int*)' does not match any in class 'clang::FileManager'
llvm-3.1\llvm\tools\clang\lib\Basic\FileManager.cpp:559:6: error: prototype for 'bool clang::FileManager::getNoncachedStatValue(llvm::StringRef, _stat64i32&)' does not match any in class 'clang::FileManager'
llvm-3.2\llvm\projects\compiler-rt\lib\enable_execute_stack.c:13:22: fatal error: sys/mman.h: No such file or directory
與LLVM-3.2的最後一個錯誤確實是通用於所有MinGW的工具鏈與LLVM-3.3以下錯誤:
mingw32-make[2]: *** No rule to make target 'lib/Target/AArch64/AArch64GenSubtargetInfo.inc', needed by 'lib/Target/AArch64/Utils/CMakeFiles/LLVMAArch64Utils.dir/AArch64BaseInfo.cpp.obj'. Stop.
謝謝。這按照描述工作。任何在TDM-GCC 64位上構建llvm的指針? – tinlyx