Hello,<br><br>I have the following error when building:<br><br>Creating library file: ../../../../lib/libclang.dll.a<br>../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x48a): undefined reference to `_imp__SymSetOptions@4'<br>
../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x4aa): undefined reference to `_imp__SymInitialize@12'<br>../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x4c3): undefined reference to `_imp__SymGetModuleBase@8'<br>
../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x4cd): undefined reference to `_imp__SymFunctionTableAccess@8'<br>../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x501): undefined reference to `_imp__StackWalk@36'<br>
../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x590): undefined reference to `_imp__SymGetModuleBase@8'<br>../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x622): undefined reference to `_imp__SymGetSymFromAddr@16'<br>
../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x6eb): undefined reference to `_imp__SymGetLineFromAddr@16'<br>../../../../lib/libLLVMSupport.a(Process.cpp.obj):Process.cpp:(.text+0xc2): undefined reference to `GetProcessMemoryInfo@12'<br>
collect2: ld returned 1 exit status<br>make[2]: *** [bin/libclang.dll] Error 1<br>make[1]: *** [tools/clang/tools/libclang/CMakeFiles/libclang.dir/all] Error 2<br><br>It occurs on r128334 and has been occuring for (at least) a week (but I didn't have time to delve into it then).<br>
<br><br>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.<br><br>
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 ?<br><br>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:<br>
<br>$ objdump -t /mingw/lib/libimagehlp.a | grep SymSetOp<br>[ 7](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 _SymSetOptions@4<br>[ 8](sec 5)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 __imp__SymSetOptions@4<br>
<br>$ objdump -t lib/libpsapi.a | grep GetProcessMemoryInfo<br>[ 7](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 _GetProcessMemoryInfo@12<br>[ 8](sec 5)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 __imp__GetProcessMemoryInfo@12<br>
<br>Since those symbols are effectively defined in my libraries, I suppose it's a Makefile issue, I use CMake to generate the Makefiles.<br><br><br>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)<br>
<br><br>Looking at the `lib/Support/CMakeFiles/LLVMSupport.dir/link.txt` only objects (no library) are referenced (I've attached it).<br><br><br>Any tips / patches appreciated :)<br><br>Matthieu.<br>