[cfe-dev] LLVM compilation error on MinGW / MSYS (CMake)
Matthieu Monrocq
matthieu.monrocq at gmail.com
Sat Mar 26 07:22:50 PDT 2011
Hello,
I have the following error when building:
Creating library file: ../../../../lib/libclang.dll.a
../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x48a):
undefined reference to `_imp__SymSetOptions at 4'
../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x4aa):
undefined reference to `_imp__SymInitialize at 12'
../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x4c3):
undefined reference to `_imp__SymGetModuleBase at 8'
../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x4cd):
undefined reference to `_imp__SymFunctionTableAccess at 8'
../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x501):
undefined reference to `_imp__StackWalk at 36'
../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x590):
undefined reference to `_imp__SymGetModuleBase at 8'
../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x622):
undefined reference to `_imp__SymGetSymFromAddr at 16'
../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x6eb):
undefined reference to `_imp__SymGetLineFromAddr at 16'
../../../../lib/libLLVMSupport.a(Process.cpp.obj):Process.cpp:(.text+0xc2):
undefined reference to `GetProcessMemoryInfo at 12'
collect2: ld returned 1 exit status
make[2]: *** [bin/libclang.dll] Error 1
make[1]: *** [tools/clang/tools/libclang/CMakeFiles/libclang.dir/all] Error
2
It occurs on r128334 and has been occuring for (at least) a week (but I
didn't have time to delve into it then).
>From what I can see the Windows specific file
lib/Support/Windows/Signals.inc and lib/Support/Windows/Process.inc
reference functions that have not been defined anywhere (yet) when
libLLVMSupport.a was built.
Searching through the repository did not yield any result on those symbols,
so I would guess they are supposed to be defined in a windows library...
somehow ?
A quick search on google brought that those are defined in `libimagehlp.a`
(for Signals.cpp stuff) and `libpsapi.a` (for Process.cpp stuff) for mingw:
$ objdump -t /mingw/lib/libimagehlp.a | grep SymSetOp
[ 7](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 _SymSetOptions at 4
[ 8](sec 5)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000
__imp__SymSetOptions at 4
$ objdump -t lib/libpsapi.a | grep GetProcessMemoryInfo
[ 7](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000
_GetProcessMemoryInfo at 12
[ 8](sec 5)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000
__imp__GetProcessMemoryInfo at 12
Since those symbols are effectively defined in my libraries, I suppose it's
a Makefile issue, I use CMake to generate the Makefiles.
I don't know much about static libraries (and not much about CMake either, I
fear), so I don't know if the symbols should be embedded directly into
libLLVMSupport.a (which sounds logical) or if the inclusion is deferred to
the clients, in case they actually need them... (in this example,
libclang.dll)
Looking at the `lib/Support/CMakeFiles/LLVMSupport.dir/link.txt` only
objects (no library) are referenced (I've attached it).
Any tips / patches appreciated :)
Matthieu.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110326/a2f26767/attachment.html>
-------------- next part --------------
D:/MinGW/bin/ar.exe cr ../libLLVMSupport.a CMakeFiles/LLVMSupport.dir/APFloat.cpp.obj CMakeFiles/LLVMSupport.dir/APInt.cpp.obj CMakeFiles/LLVMSupport.dir/APSInt.cpp.obj CMakeFiles/LLVMSupport.dir/Allocator.cpp.obj CMakeFiles/LLVMSupport.dir/circular_raw_ostream.cpp.obj CMakeFiles/LLVMSupport.dir/CommandLine.cpp.obj CMakeFiles/LLVMSupport.dir/ConstantRange.cpp.obj CMakeFiles/LLVMSupport.dir/CrashRecoveryContext.cpp.obj CMakeFiles/LLVMSupport.dir/Debug.cpp.obj CMakeFiles/LLVMSupport.dir/DeltaAlgorithm.cpp.obj CMakeFiles/LLVMSupport.dir/DAGDeltaAlgorithm.cpp.obj CMakeFiles/LLVMSupport.dir/Dwarf.cpp.obj CMakeFiles/LLVMSupport.dir/ErrorHandling.cpp.obj CMakeFiles/LLVMSupport.dir/FileUtilities.cpp.obj CMakeFiles/LLVMSupport.dir/FoldingSet.cpp.obj CMakeFiles/LLVMSupport.dir/FormattedStream.cpp.obj CMakeFiles/LLVMSupport.dir/GraphWriter.cpp.obj CMakeFiles/LLVMSupport.dir/IntEqClasses.cpp.obj CMakeFiles/LLVMSupport.dir/IntervalMap.cpp.obj CMakeFiles/LLVMSupport.dir/IsInf.cpp.obj CMakeFiles/LLVMSupport.dir/IsNAN.cpp.obj CMakeFiles/LLVMSupport.dir/ManagedStatic.cpp.obj CMakeFiles/LLVMSupport.dir/MemoryBuffer.cpp.obj CMakeFiles/LLVMSupport.dir/MemoryObject.cpp.obj CMakeFiles/LLVMSupport.dir/PluginLoader.cpp.obj CMakeFiles/LLVMSupport.dir/PrettyStackTrace.cpp.obj CMakeFiles/LLVMSupport.dir/Regex.cpp.obj CMakeFiles/LLVMSupport.dir/SmallPtrSet.cpp.obj CMakeFiles/LLVMSupport.dir/SmallVector.cpp.obj CMakeFiles/LLVMSupport.dir/SourceMgr.cpp.obj CMakeFiles/LLVMSupport.dir/Statistic.cpp.obj CMakeFiles/LLVMSupport.dir/StringExtras.cpp.obj CMakeFiles/LLVMSupport.dir/StringMap.cpp.obj CMakeFiles/LLVMSupport.dir/StringPool.cpp.obj CMakeFiles/LLVMSupport.dir/StringRef.cpp.obj CMakeFiles/LLVMSupport.dir/SystemUtils.cpp.obj CMakeFiles/LLVMSupport.dir/TargetRegistry.cpp.obj CMakeFiles/LLVMSupport.dir/Timer.cpp.obj CMakeFiles/LLVMSupport.dir/ToolOutputFile.cpp.obj CMakeFiles/LLVMSupport.dir/Triple.cpp.obj CMakeFiles/LLVMSupport.dir/Twine.cpp.obj CMakeFiles/LLVMSupport.dir/raw_os_ostream.cpp.obj CMakeFiles/LLVMSupport.dir/raw_ostream.cpp.obj CMakeFiles/LLVMSupport.dir/regcomp.c.obj CMakeFiles/LLVMSupport.dir/regerror.c.obj CMakeFiles/LLVMSupport.dir/regexec.c.obj CMakeFiles/LLVMSupport.dir/regfree.c.obj CMakeFiles/LLVMSupport.dir/regstrlcpy.c.obj CMakeFiles/LLVMSupport.dir/Atomic.cpp.obj CMakeFiles/LLVMSupport.dir/Disassembler.cpp.obj CMakeFiles/LLVMSupport.dir/DynamicLibrary.cpp.obj CMakeFiles/LLVMSupport.dir/Errno.cpp.obj CMakeFiles/LLVMSupport.dir/Host.cpp.obj CMakeFiles/LLVMSupport.dir/IncludeFile.cpp.obj CMakeFiles/LLVMSupport.dir/Memory.cpp.obj CMakeFiles/LLVMSupport.dir/Mutex.cpp.obj CMakeFiles/LLVMSupport.dir/Path.cpp.obj CMakeFiles/LLVMSupport.dir/PathV2.cpp.obj CMakeFiles/LLVMSupport.dir/Process.cpp.obj CMakeFiles/LLVMSupport.dir/Program.cpp.obj CMakeFiles/LLVMSupport.dir/RWMutex.cpp.obj CMakeFiles/LLVMSupport.dir/SearchForAddressOfSpecialSymbol.cpp.obj CMakeFiles/LLVMSupport.dir/Signals.cpp.obj CMakeFiles/LLVMSupport.dir/system_error.cpp.obj CMakeFiles/LLVMSupport.dir/ThreadLocal.cpp.obj CMakeFiles/LLVMSupport.dir/Threading.cpp.obj CMakeFiles/LLVMSupport.dir/TimeValue.cpp.obj CMakeFiles/LLVMSupport.dir/Valgrind.cpp.obj
D:/MinGW/bin/ranlib.exe ../libLLVMSupport.a
More information about the cfe-dev
mailing list