[LLVMdev] mingw build problems

Jay Foad jay.foad at gmail.com
Fri Apr 17 07:58:46 PDT 2009


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.

Thanks,
Jay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.die
Type: application/octet-stream
Size: 892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090417/6fc571e3/attachment.obj>


More information about the llvm-dev mailing list