tag:blogger.com,1999:blog-8361942945221983453.post3709256881266524273..comments2024-03-24T13:09:14.304+00:00Comments on Pete's Blog: Building and running Clang static-analyzer on Windows/MinGWPetehttp://www.blogger.com/profile/00656449482260202625noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-8361942945221983453.post-2431566725155704022015-04-28T21:55:06.784+01:002015-04-28T21:55:06.784+01:00I am getting the same error described here: http:/...I am getting the same error described here: http://sourceforge.net/p/mingw/bugs/2043/ (error: 'FE_ALL_EXCEPT' was not declared in this scope ... error: 'feclearexcept' was not declared in this scope ... error: 'FE_INEXACT' was not declared in this scope) <br /><br />If I comment out the few lines in that file, the build goes much farther, but after much work, still dies while linking:<br /><br />llvm[2]: ======= Finished Linking Release+Asserts Executable llvm-profdata (without symbols)<br />make[2]: Leaving directory `/src/build/tools/llvm-profdata'<br />make[2]: Entering directory `/src/build/tools/llvm-symbolizer'<br />llvm[2]: Compiling LLVMSymbolize.cpp for Release+Asserts build<br />llvm[2]: Compiling llvm-symbolizer.cpp for Release+Asserts build<br />llvm[2]: Linking Release+Asserts executable llvm-symbolizer (without symbols)<br />C:/MinGW/msys/1.0/src/build/Release+Asserts/lib/libLLVMSupport.a(COM.o):COM.cpp:(.text+0x24): undefined refere<br />nce to `CoInitializeEx@8'<br />C:/MinGW/msys/1.0/src/build/Release+Asserts/lib/libLLVMSupport.a(COM.o):COM.cpp:(.text+0x31): undefined refere<br />nce to `CoUninitialize@0'<br />c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: C:/MinGW/msys/1.0/src/build/Release+Asse<br />rts/lib/libLLVMSupport.a(COM.o): bad reloc address 0x20 in section `.eh_frame'<br />collect2.exe: error: ld returned 1 exit status<br />make[2]: *** [/usr/src/build/Release+Asserts/bin/llvm-symbolizer.exe] Error 1<br />make[2]: Leaving directory `/src/build/tools/llvm-symbolizer'<br />make[1]: *** [llvm-symbolizer/.makeall] Error 2<br />make[1]: Leaving directory `/src/build/tools'<br />make: *** [all] Error 1<br /><br />How do I get past these errors?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8361942945221983453.post-10742036318313055142014-07-10T23:55:24.273+01:002014-07-10T23:55:24.273+01:00Thanks! I have now updated the step.Thanks! I have now updated the step.Petehttps://www.blogger.com/profile/00656449482260202625noreply@blogger.comtag:blogger.com,1999:blog-8361942945221983453.post-26730097944310644522014-07-04T12:18:00.140+01:002014-07-04T12:18:00.140+01:00Your step 11 does not do what you seem to think: i...Your step 11 does not do what you seem to think: it leaves both CC and CXX both defined and exported, but simply with a value equal to the empty string. To do it properly, you need:<br /><br />$ export -n CC CXX<br />$ unset CC CXX<br /><br />Better still, don't export them in the first place, at step 5; if you really do need to override what configure will discover for itself, just define them within the configure command itself:<br /><br />$ ../llvm/configure CC=gcc CXX=g++ --disable-docs --enable-optimized --enable-targets=x86,x86_64 --prefix=/mingw<br /><br />is the preferred format, when configure has been generated with a version of GNU autoconf from about 2.50 onwards, or<br /><br />$ CC=gcc CXX=g++ ../llvm/configure --disable-docs --enable-optimized --enable-targets=x86,x86_64 --prefix=/mingw<br /><br />to temporarily export them, for configure generated otherwise.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8361942945221983453.post-62763467756204898922012-10-14T03:28:39.980+01:002012-10-14T03:28:39.980+01:00Excellent instructions. Thank you for helping me t...Excellent instructions. Thank you for helping me to go a long way towards a long term aspiration to run Clang static analyser over our code (with the bonus of compiling it under Clang for an alternative set ofwarnings to g++). Apart from a few svn oddities for the Clang code all went smoothly and I even managed to integrate it with my NetBeans IDE making the makefile a bit more project wise than my original knocked up batch version for the command lineMichaelhttps://www.blogger.com/profile/00220672181227533146noreply@blogger.comtag:blogger.com,1999:blog-8361942945221983453.post-61104598633588681462012-06-12T17:18:26.255+01:002012-06-12T17:18:26.255+01:00See http://lists.cs.uiuc.edu/pipermail/llvmbugs/20...See <a href="http://lists.cs.uiuc.edu/pipermail/llvmbugs/2012-March/022344.html" rel="nofollow">http://lists.cs.uiuc.edu/pipermail/llvmbugs/2012-March/022344.html</a><br /><br />I got the error as well, and it looks like, since we're recompiling and reinstalling Clang anyway, the better approach is to skip the installation of the MinGW32 Clang binaries (step 3), and instead set CC to gcc and CXX to g++.<br /><br />I have now amended the guide to do just that.Pete Batardhttps://www.blogger.com/profile/09315085625194033420noreply@blogger.comtag:blogger.com,1999:blog-8361942945221983453.post-85089456092139937622012-06-04T03:15:30.565+01:002012-06-04T03:15:30.565+01:00I get up to the last command in step 5 (make -j2) ...I get up to the last command in step 5 (make -j2) and get errors saying that 'cmath' file not found. Any suggestions?Malcolmhttps://www.blogger.com/profile/00050311457248607328noreply@blogger.comtag:blogger.com,1999:blog-8361942945221983453.post-20633342483073116182012-03-26T16:27:32.490+01:002012-03-26T16:27:32.490+01:00I am unable to fix the bug "tblgen.exe stoppe...I am unable to fix the bug "tblgen.exe stopped working". What should i do?<br />I am using vista OS.Akshayhttps://www.blogger.com/profile/11806269505384118492noreply@blogger.comtag:blogger.com,1999:blog-8361942945221983453.post-73763333089163437352011-12-17T01:20:43.116+00:002011-12-17T01:20:43.116+00:00awesome - saved me a bunch of time - using the cla...awesome - saved me a bunch of time - using the clang front end binaries for mingw32 x86 is not well documented. I was able to get clang working on an existing MINGW install by copying the content of the clang (bin/, include/ ...) to the mingw "folders". example C:\MinGW\lib\clang\2.9\include <br /><br />$ clang -o hello hel.c<br /><br />$ ./hello<br />hello clang from mingwMarcohttps://www.blogger.com/profile/12951600710101631626noreply@blogger.com