Hi, I'm trying to build clang under MingW, but I'm getting a number of errors. Could anyone provide some hints as to what you had to do? I got some tips from http://blogs.tedneward.com/2008/02/24/Building+LLVM+On+Windows+Using+MinGW32.aspx, but using the newer packages, as it's a bit old. The ./configure seems to run without errors. The first run of make aborts with errors like: make[1]: Entering directory `/home/llvm/tools/llvm-config' llvm[1]: Regenerating LibDeps.txt.tmp 'c:' is not recognized as an internal or external command, operable program or batch file. nm failed at C:/msys/1.0/home/llvm/utils/GenLibDeps.pl line 120. make[1]: *** [/home/llvm/tools/llvm-config/LibDeps.txt.tmp] Error 255 make[1]: Leaving directory `/home/llvm/tools/llvm-config' make: *** [all] Error 1 So it seemed like something in the llvm-config directory, so I ran "make clean all" directly in llvm/tools/llvm-config, but had no error. Running make again at the llvm directory yielded different errors this time: make[2]: Entering directory `/home/llvm/tools/llvm-config' make[2]: Leaving directory `/home/llvm/tools/llvm-config' The system cannot find the path specified. llvm-config: unknown component name: bitreader The system cannot find the path specified. llvm-config: unknown component name: bitreader make[2]: Entering directory `/home/llvm/tools/opt' llvm[2]: Linking Debug executable opt C:/msys/1.0/home/llvm/tools/opt/Debug/AnalysisWrappers.o: In function `ZN49_GLOBAL__N_AnalysisWrappers.cpp_DD76033A_F5DF9E8F16CallGraphPrinterD1Ev': C:/msys/1.0/home/llvm/tools/opt/AnalysisWrappers.cpp:(.rdata+0xb0): undefined reference to `llvm::CallGraphLinkVar' C:/msys/1.0/home/llvm/tools/opt/AnalysisWrappers.cpp:(.text$_ZN4llvm8PassInfoC2EPKcS2_iPFPNS_4PassEvEbb[llvm::PassInfo::PassInfo(char const*, char const*, int, llvm::Pass* (*)(), bool, bool)]+0xea): undefined reference to `llvm::PassInfo::registerPass()' C:/msys/1.0/home/llvm/tools/opt/AnalysisWrappers.cpp:(.text$_ZN4llvm10ModulePassC2EPKv[llvm::ModulePass::ModulePass(void const*)]+0x1d): undefined reference to `vtable for llvm::ModulePass' ... and lots more Running make in the clang top level had link errors too, undoubtedly because the llvm build failed: make[1]: Entering directory `/home/llvm/tools/clang/tools' The system cannot find the path specified. llvm-config: unknown component name: x86info make[2]: Entering directory `/home/llvm/tools/clang/tools/clang-cc' llvm[2]: Compiling clang-cc.cpp for Debug build The system cannot find the path specified. llvm-config: unknown component name: x86info llvm[2]: Linking Debug executable clang-cc C:/msys/1.0/home/llvm/tools/clang/tools/clang-cc/Debug/clang-cc.o: In function `Z22InitializeBaseLanguagev': C:/msys/1.0/home/llvm/tools/clang/tools/clang-cc/clang-cc.cpp:395: undefined reference to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::operator bool() const' C:/msys/1.0/home/llvm/tools/clang/tools/clang-cc/clang-cc.cpp:397: undefined reference to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::operator bool() const' C:/msys/1.0/home/llvm/tools/clang/tools/clang-cc/Debug/clang-cc.o: In function `Z21InitializeLangOptionsRN5clang11LangOptionsE8LangKind': I can dig into it further, but I thought it worthwhile to ping you guys in case you can straighten me out more easily, as I haven't done a lot of work in this environment with configure and so forth. Setting up Msys and MingW doesn't seem very straightforward, so I'm wondering if I misstepped somewhere and missed a package I need, or got the wrong version, or have some other cruft in my setup. If it will help, I can send logs of the configure, llvm build, a "make -n" build of llvm, the 2nd build of llvm, the clang build, and the config.status and config.log files. (Actually, I tried sending them already, but of course they're too big.) -John -- John Thompson John.Thompson.JTSoftware at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090805/2bbf06a4/attachment.html>
John Thompson wrote:> Hi, > > I'm trying to build clang under MingW, but I'm getting a number of > errors. Could anyone provide some hints as to what you had to do? I > got some tips from > http://blogs.tedneward.com/2008/02/24/Building+LLVM+On+Windows+Using+MinGW32.aspx, > but using the newer packages, as it's a bit old. > > The ./configure seems to run without errors. > > The first run of make aborts with errors like: > > make[1]: Entering directory `/home/llvm/tools/llvm-config' > llvm[1]: Regenerating LibDeps.txt.tmp > 'c:' is not recognized as an internal or external command, > operable program or batch file. > nm failed at C:/msys/1.0/home/llvm/utils/GenLibDeps.pl line 120. > make[1]: *** [/home/llvm/tools/llvm-config/LibDeps.txt.tmp] Error 255 > make[1]: Leaving directory `/home/llvm/tools/llvm-config' > make: *** [all] Error 1 > > > So it seemed like something in the llvm-config directory, so I ran > "make clean all" directly in llvm/tools/llvm-config, but had no error. > > Running make again at the llvm directory yielded different errors this > time: >Ok, sounds like a different problem than the one I have to patch around (stock LLVM always dies on me with the cited error message, problem is cmd.exe command shell from using ActivePerl; you got past that). Which distribution of Perl are you using? Kenneth
Anton Korobeynikov
2009-Aug-06 08:17 UTC
[LLVMdev] [cfe-dev] Problems building on Msys/MingW
Hello, John> make[1]: Entering directory `/home/llvm/tools/llvm-config' > llvm[1]: Regenerating LibDeps.txt.tmp > 'c:' is not recognized as an internal or external command, > operable program or batch file. > nm failed at C:/msys/1.0/home/llvm/utils/GenLibDeps.pl line 120. > make[1]: *** [/home/llvm/tools/llvm-config/LibDeps.txt.tmp] Error 255 > make[1]: Leaving directory `/home/llvm/tools/llvm-config' > make: *** [all] Error 1This is the source of all other problems. Are you using perl from msysDTK?> C:/msys/1.0/home/llvm/tools/opt/AnalysisWrappers.cpp:(.text$_ZN4llvm10ModulePassC2EPKv[llvm::ModulePass::ModulePass(void > const*)]+0x1d): undefined reference to `vtable for llvm::ModulePass' > ... and lots moreThat's due to broken llvm-config, see that 'unknown component' errors.> C:/msys/1.0/home/llvm/tools/clang/tools/clang-cc/Debug/clang-cc.o: In > function `Z22InitializeBaseLanguagev':Same here. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
I had Strawberry Perl, which was the problem. I installed the Perl from the MSYS distribution and it now works. I've enclosed a patch for the Getting Started page. Thanks for pointing me in the right direction. -John>On Wed, Aug 5, 2009 at 5:36 PM, Kenneth Boyd <zaimoni at zaimoni.com> wrote:> John Thompson wrote: > > Hi, > > > > I'm trying to build clang under MingW, but I'm getting a number of > > errors. Could anyone provide some hints as to what you had to do? >> Ok, sounds like a different problem than the one I have to patch around(stock LLVM always dies on me with the cited error message, problem is cmd.exe command shell from using ActivePerl; you got past that). Which distribution of Perl are you using? Kenneth -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090806/1e3030e5/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: llvmgettingstarted.patch Type: application/octet-stream Size: 1073 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090806/1e3030e5/attachment.obj>