[cfe-dev] Undefined reference cross-compiling shared llvm/clang for mingw

Abramo Bagnara abramo.bagnara at gmail.com
Wed Jul 27 12:00:31 PDT 2011


Using the following configure command:

../llvm-r136065/configure --host=i586-mingw32msvc
--enable-targets=host-only --disable-jit --enable-bindings=none
--enable-shared --disable-threads --disable-pthreads
--disable-assertions --disable-optimized

I get a bunch of undefined reference on each executable linking, the
first lines listed below.

I've verified that replacing --enable-shared in configure command line
with --disable-shared the errors disappears.

Someone knows why this happens?


llvm[2]: Linking Debug executable opt
i586-mingw32msvc-g++ -I/tmp/llvm-r136065-build/include
-I/tmp/llvm-r136065-build/tools/opt -I/tmp/llvm-r136065/include
-I/tmp/llvm-r136065/tools/opt  -DNDEBUG -D__NO_CTYPE_INLINE
-D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g
-fno-exceptions -fno-rtti -Woverloaded-virtual -Wcast-qual  -g
-L/tmp/llvm-r136065-build/Debug/lib -L/tmp/llvm-r136065-build/Debug/lib
   -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter
-Wwrite-strings   -o /tmp/llvm-r136065-build/Debug/bin/opt.exe
/tmp/llvm-r136065-build/tools/opt/Debug/AnalysisWrappers.o
/tmp/llvm-r136065-build/tools/opt/Debug/GraphPrinters.o
/tmp/llvm-r136065-build/tools/opt/Debug/PrintSCC.o /tmp/llvm-r13
6065-build/tools/opt/Debug/opt.o  \
        -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc -L
/tmp/llvm-r136065-build/Debug/bin -lLLVM-3.0svn   -lpsapi -limagehlp -lm
/tmp/llvm-r136065-build/tools/opt/Debug/
AnalysisWrappers.o:AnalysisWrappers.cpp:(.debug_info+0x40eb): undefined
reference to `llvm::CallGraphLinkVar'
/tmp/llvm-r136065-build/tools/opt/Debug/
AnalysisWrappers.o: In function `ModulePass':
/tmp/llvm-r136065/include/llvm/Pass.h:235: undefined reference to
`vtable for llvm::ModulePass'
/tmp/llvm-r136065-build/tools/opt/Debug/AnalysisWrappers.o:AnalysisWrappers.cpp:(.rdata+0x0):
undefined reference to `llvm::CallGraphLinkVar'
/tmp/llvm-r136065-build/tools/opt/Debug/AnalysisWrappers.o:/tmp/llvm-r136065/include/llvm/PassAnalysisSupport.h:61:
undefined reference to `llvm::CallGraph::ID'
/tmp/llvm-r136065-build/tools/opt/Debug/AnalysisWrappers.o:/tmp/llvm-r136065/include/llvm/PassAnalysisSupport.h:200:
undefined reference to `llvm::CallGraph::ID'
/tmp/llvm-r136065-build/tools/opt/Debug/GraphPrinters.o:GraphPrinters.cpp:(.debug_info+0x7ce7):
undefined reference to `llvm::CallGraphLinkVar'
/tmp/llvm-r136065-build/tools/opt/Debug/GraphPrinters.o:GraphPrinters.cpp:(.rdata+0x4):
undefined reference to `llvm::CallGraphLinkVar'
/tmp/llvm-r136065-build/tools/opt/Debug/GraphPrinters.o:GraphPrinters.cpp:(.text$_ZN4llvm11raw_ostreamC2Eb[llvm::raw_ostream::raw_ostream(bool)]+0x11):
undefined reference to `vtable for llvm::raw_ostream'
/tmp/llvm-r136065-build/tools/opt/Debug/GraphPrinters.o:GraphPrinters.cpp:(.text$_ZN4llvm18raw_string_ostreamC1ERSs[llvm::raw_string_ostream::raw_string_ostream(std::basic_string<char,
std::char_traits<char>, std::allocator<char> >&)]+0x1e): undefined
reference to `vtable for llvm::raw_string_ostream'
/tmp/llvm-r136065-build/tools/opt/Debug/GraphPrinters.o:GraphPrinters.cpp:(.text$_ZN4llvm12FunctionPassC2ERc[llvm::FunctionPass::FunctionPass(char&)]+0x25):
undefined reference to `vtable for llvm::FunctionPass'
/tmp/llvm-r136065-build/tools/opt/Debug/GraphPrinters.o:GraphPrinters.cpp:(.text$_ZN4llvm12FunctionPassD2Ev[llvm::FunctionPass::~FunctionPass()]+0xb):
undefined reference to `vtable for llvm::FunctionPass'
/tmp/llvm-r136065-build/tools/opt/Debug/GraphPrinters.o:GraphPrinters.cpp:(.text$_ZN4llvm13AnalysisUsage11addRequiredINS_9CallGraphEEERS0_v[llvm::AnalysisUsage&
llvm::AnalysisUsage::addRequired<llvm::CallGraph>()]+0xa): undefined
reference to `llvm::CallGraph::ID'



More information about the cfe-dev mailing list