Clang build failure on Windows

Hi,

with the latest svn version of clang and LLVM (r126030), I get this
build error in Clang on windows (x86_64-w64-mingw32):

[ 93%] Building CXX object
tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/clangStaticAnalyzerFrontend.dir/AnalysisConsumer.cpp.obj
In file included from
M:\Development\Source\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\AnalysisConsumer.cpp:34:0:
M:\Development\Source\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\/../Checkers/ClangSACheckers.h:26:24:
fatal error: Checkers.inc: No such file or directory
compilation terminated.
gmake[2]: *** [tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/clangStaticAnalyzerFrontend.dir/AnalysisConsumer.cpp.obj]
Error 1
gmake[1]: *** [tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/clangStaticAnalyzerFrontend.dir/all]
Error 2
gmake: *** [all] Error 2

What's wrong?

Thanks

Ruben

[Seems that stupid gmane ate my previous post. Sorry if this is a
duplicate]

Hello Ruben.

Ruben Van Boxem <vanboxem.ruben@gmail.com>
writes:

with the latest svn version of clang and LLVM (r126030), I get this
build error in Clang on windows (x86_64-w64-mingw32):

[ 93%] Building CXX object
tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/clangStaticAnalyzerFrontend.dir/AnalysisConsumer.cpp.obj
In file included from
M:\Development\Source\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\AnalysisConsumer.cpp:34:0:
M:\Development\Source\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\/../Checkers/ClangSACheckers.h:26:24:
fatal error: Checkers.inc: No such file or directory
compilation terminated.
gmake[2]: *** [tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/clangStaticAnalyzerFrontend.dir/AnalysisConsumer.cpp.obj]
Error 1
gmake[1]: *** [tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/clangStaticAnalyzerFrontend.dir/all]
Error 2
gmake: *** [all] Error 2

What's wrong?

I'll look at this issue later this weekend, but in the meantime it would
be great if you can provide some additional info:

* How are you building LLVM/Clang? Complete cmake command. Generator
   used: MSYS or MinGW makefies?

* The complete compiler invokation at the failure point. You can see
   that with

   make VERBOSE=1

Thanks.

Ruben Van Boxem <vanboxem.ruben@gmail.com>
writes:

> with the latest svn version of clang and LLVM (r126030), I get this
> build error in Clang on windows (x86_64-w64-mingw32):
>
> [ 93%] Building CXX object
> tools/clang/lib/
StaticAnalyzer/Frontend/CMakeFiles/clangStaticAnalyzerFrontend.dir/AnalysisConsumer.cpp.obj
> In file included from
> M:\Development\Source\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\AnalysisConsumer.cpp:34:0:
> M:\Development\Source\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\/../Checkers/ClangSACheckers.h:26:24:
> fatal error: Checkers.inc: No such file or directory
> compilation terminated.
> gmake[2]: *** [tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/clangStaticAnalyzerFrontend.dir/AnalysisConsumer.cpp.obj]
> Error 1
> gmake[1]: *** [tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/clangStaticAnalyzerFrontend.dir/all]
> Error 2
> gmake: *** [all] Error 2
>
> What's wrong?

I'll look at this issue later this weekend, but in the meantime it would
be great if you can provide some additional info:

* How are you building LLVM/Clang? Complete cmake command. Generator
used: MSYS or MinGW makefies?

* The complete compiler invokation at the failure point. You can see
that with

make VERBOSE=1

Thanks.

Hi,

I'm building with

cmake ../../Source/LLVM -G"MinGW Makefiles"

and the output of

mingw32-make VERBOSE=1

is the following:

[ 92%] Building CXX object
tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/clangStaticAnalyzerFrontend.dir/AnalysisConsumer.cpp.obj
cd M:\Development\x64\LLVM\tools\clang\lib\StaticAnalyzer\Frontend &&
M:\Development\mingw64\bin\g++.exe -DNDEBUG -D__STDC_LIMIT_MACROS
-D__STDC_CONSTANT_MACROS -D_GNU_SOURCE -DHAVE_CLANG_CONFIG_H
-fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing
-pedantic -Wno-long-long -Wall -W -Wno-unused-parameter
-Wwrite-strings -fno-rtti
-IM:\Development\x64\LLVM\tools\clang\lib\StaticAnalyzer\Frontend
-IM:\Development\Source\LLVM\tools\clang\lib\StaticAnalyzer\Frontend
-IM:\Development\x64\LLVM\include -IM:\Development\Source\LLVM\include
-IM:\Development\Source\LLVM\tools\clang\include
-IM:\Development\x64\LLVM\tools\clang\include
-IM:\Development\x64\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\..\Checkers
  -fno-exceptions -o
CMakeFiles\clangStaticAnalyzerFrontend.dir\AnalysisConsumer.cpp.obj -c
M:\Development\Source\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\AnalysisConsumer.cpp
In file included from
M:\Development\Source\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\AnalysisConsumer.cpp:34:0:
M:\Development\Source\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\/../Checkers/ClangSACheckers.h:26:24:
fatal error: Checkers.inc: No such file or directory
compilation terminated.
gmake[2]: *** [tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/clangStaticAnalyzerFrontend.dir/AnalysisConsumer.cpp.obj]
Error 1
gmake[2]: Leaving directory `M:/Development/x64/LLVM'
gmake[1]: *** [tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/clangStaticAnalyzerFrontend.dir/all]
Error 2
gmake[1]: Leaving directory `M:/Development/x64/LLVM'
gmake: *** [all] Error 2

Thanks for the quick response!

Ruben

Ruben Van Boxem <vanboxem.ruben@gmail.com>
writes:

I'm building with

cmake ../../Source/LLVM -G"MinGW Makefiles"

and the output of

mingw32-make VERBOSE=1

is the following:

[ 92%] Building CXX object
tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/clangStaticAnalyzerFrontend.dir/AnalysisConsumer.cpp.obj
cd M:\Development\x64\LLVM\tools\clang\lib\StaticAnalyzer\Frontend &&
M:\Development\mingw64\bin\g++.exe -DNDEBUG -D__STDC_LIMIT_MACROS
-D__STDC_CONSTANT_MACROS -D_GNU_SOURCE -DHAVE_CLANG_CONFIG_H
-fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing
-pedantic -Wno-long-long -Wall -W -Wno-unused-parameter
-Wwrite-strings -fno-rtti
-IM:\Development\x64\LLVM\tools\clang\lib\StaticAnalyzer\Frontend
-IM:\Development\Source\LLVM\tools\clang\lib\StaticAnalyzer\Frontend
-IM:\Development\x64\LLVM\include -IM:\Development\Source\LLVM\include
-IM:\Development\Source\LLVM\tools\clang\include
-IM:\Development\x64\LLVM\tools\clang\include
-IM:\Development\x64\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\..\Checkers
  -fno-exceptions -o
CMakeFiles\clangStaticAnalyzerFrontend.dir\AnalysisConsumer.cpp.obj -c
M:\Development\Source\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\AnalysisConsumer.cpp
In file included from
M:\Development\Source\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\AnalysisConsumer.cpp:34:0:
M:\Development\Source\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\/../Checkers/ClangSACheckers.h:26:24:
fatal error: Checkers.inc: No such file or directory

The

-IM:\Development\x64\LLVM\tools\clang\lib\StaticAnalyzer\Frontend\..\Checkers

above should take care of finding Checkers.inc. Can you verify that
Checkers.inc exists in

M:\Development\x64\LLVM\tools\clang\lib\StaticAnalyzer\Checkers

?

BTW, I just built LLVM+Clang with MinGW 32 bits using MSYS.

Oh, there is something fishy on the usage of add_dependencies on those
CMakeLists.txt files. Please see if this two patches allows you to move
a bit forward on the build:

diff --git a/lib/StaticAnalyzer/Checkers/CMakeLists.txt b/lib/StaticAnalyzer/Checkers/CMakeLists.txt
index bf424e2..79a67e3 100644
--- a/lib/StaticAnalyzer/Checkers/CMakeLists.txt
+++ b/lib/StaticAnalyzer/Checkers/CMakeLists.txt
@@ -60,5 +60,6 @@ add_clang_library(clangStaticAnalyzerCheckers
   VLASizeChecker.cpp
   )

-add_dependencies(clangStaticAnalyzerCore ClangAttrClasses ClangAttrList ClangDeclNodes
- ClangStmtNodes ClangSACheckers)
+add_dependencies(clangStaticAnalyzerCheckers
+ clangStaticAnalyzerCore ClangAttrClasses ClangAttrList ClangDeclNodes
+ ClangStmtNodes ClangSACheckers)

diff --git a/lib/StaticAnalyzer/Frontend/CMakeLists.txt b/lib/StaticAnalyzer/Frontend/CMakeLists.txt
index cf47c47..c1f9258 100644
--- a/lib/StaticAnalyzer/Frontend/CMakeLists.txt
+++ b/lib/StaticAnalyzer/Frontend/CMakeLists.txt
@@ -10,5 +10,6 @@ add_clang_library(clangStaticAnalyzerFrontend
   FrontendActions.cpp
   )

-add_dependencies(clangStaticAnalyzerCheckers clangStaticAnalyzerCore ClangAttrClasses ClangAttrList ClangDeclNodes
- ClangStmtNodes)
+add_dependencies(clangStaticAnalyzerFrontend
+ clangStaticAnalyzerCheckers clangStaticAnalyzerCore ClangAttrClasses ClangAttrList ClangDeclNodes
+ ClangStmtNodes)

This was fixed for me somewhere before or at r126077. Sorry for the noise.

Ruben

Ruben Van Boxem <vanboxem.ruben@gmail.com>
writes:

fatal error: Checkers.inc: No such file or directory
compilation terminated.

This was fixed for me somewhere before or at r126077. Sorry for the noise.

It wasn't noise. Your report prompted the fix.