[LLVMdev] mingw build problems

Kenneth Boyd zaimoni at zaimoni.com
Tue Apr 28 02:04:31 PDT 2009


Jay Foad wrote:
> I'm trying to cross-compile LLVM with build=, host=target=. I'm using
> the following packages from Debian lenny:
>
> mingw32 4.2.1.dfsg-1
> mingw32-binutils 2.18.50-20080109-1
> mingw32-runtime 3.13-1
>
> The first problem I hit was when I configured with CC, CXX, AR and
> RANLIB set to mingw cross-tools, but forgot to specify NM as well.
> This resulted in a load of warnings that scrolled off the screen:
>
> nm: AliasAnalysis.o: File format not recognized
> nm: AliasAnalysisCounter.o: File format not recognized
> nm: AliasAnalysisEvaluator.o: File format not recognized
> nm: AliasDebugger.o: File format not recognized
> nm: AliasSetTracker.o: File format not recognized
> nm: Analysis.o: File format not recognized
> ...
>
> followed by millions of undefined symbols when linking any executable:
>
> llvm[2]: Linking Debug executable opt
> /home/foad/llvm/objdir-mingw/tools/opt/Debug/AnalysisWrappers.o: In
> function `~CallGraphPrinter':
> /home/foad/svn/llvm-project/llvm/trunk/tools/opt/AnalysisWrappers.cpp:71:
> undefined reference to `llvm::ModulePass::~ModulePass()'
> /home/foad/svn/llvm-project/llvm/trunk/tools/opt/AnalysisWrappers.cpp:71:
> undefined reference to `llvm::ModulePass::~ModulePass()'
> /home/foad/llvm/objdir-mingw/tools/opt/Debug/AnalysisWrappers.o: In
> function `~ExternalFunctionsPassedConstants':
> /home/foad/svn/llvm-project/llvm/trunk/tools/opt/AnalysisWrappers.cpp:32:
> undefined reference to `llvm::ModulePass::~ModulePass()'
> /home/foad/svn/llvm-project/llvm/trunk/tools/opt/AnalysisWrappers.cpp:32:
> undefined reference to `llvm::ModulePass::~ModulePass()'
> /home/foad/llvm/objdir-mingw/tools/opt/Debug/AnalysisWrappers.o:AnalysisWrappers.cpp:(.debug_info+0x1ba6):
> undefined reference to `llvm::CallGraphLinkVar'
> ...
>
> The attached patch makes GenLibDeps.pl notice that nm has failed, so
> that the build fails immediately rather than giving more obscure
> errors later on.
>   
I see (the hard way) that this patch also turns the fallback code for 
broken pipes on cmd.exe command shell into dead code (which breaks 
native MinGW build/ActivePerl ).

That said, dying on totally absent nm makes sense.  Attaching patch to 
retain die on absent nm while permitting the fallback code to run.

Kenneth Boyd
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: GenLibDeps.pl.patch
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090428/2c9db298/attachment.ksh>


More information about the llvm-dev mailing list