FindLibXml2: 3.29.0 finds wrong libxml2.a in build for MSVC ABI
related #23975 (closed) !9173 (merged)
currently trying to update CMake in vcpkg to 3.29 and saw this:
[5067/5075] C:\Windows\system32\cmd.exe /C "cd . && D:\downloads\tools\cmake-3.29.0-windows\cmake-3.29.0-windows-i386\bin\cmake.exe -E vs_link_dll --intdir=tools\lldb\source\API\CMakeFiles\liblldb.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x86\link.exe @CMakeFiles\liblldb.rsp /out:bin\liblldb.dll /implib:lib\liblldb.lib /pdb:bin\liblldb.pdb /dll /version:17.0 /machine:X86 /nologo /debug /INCREMENTAL && cd ."
FAILED: bin/liblldb.dll lib/liblldb.lib
C:\Windows\system32\cmd.exe /C "cd . && D:\downloads\tools\cmake-3.29.0-windows\cmake-3.29.0-windows-i386\bin\cmake.exe -E vs_link_dll --intdir=tools\lldb\source\API\CMakeFiles\liblldb.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x86\link.exe @CMakeFiles\liblldb.rsp /out:bin\liblldb.dll /implib:lib\liblldb.lib /pdb:bin\liblldb.pdb /dll /version:17.0 /machine:X86 /nologo /debug /INCREMENTAL && cd ."
LINK Pass 1: command "C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x86\link.exe @CMakeFiles\liblldb.rsp /out:bin\liblldb.dll /implib:lib\liblldb.lib /pdb:bin\liblldb.pdb /dll /version:17.0 /machine:X86 /nologo /debug /INCREMENTAL /MANIFEST /MANIFESTFILE:tools\lldb\source\API\CMakeFiles\liblldb.dir/intermediate.manifest tools\lldb\source\API\CMakeFiles\liblldb.dir/manifest.res" failed (exit code 1120) with the following output:
Creating library lib\liblldb.lib and object lib\liblldb.exp
lldbHost.lib(XML.cpp.obj) : error LNK2019: unresolved external symbol __imp__xmlFreeDoc referenced in function "public: void __thiscall lldb_private::XMLDocument::Clear(void)" (?Clear@XMLDocument@lldb_private@@QAEXXZ)
lldbHost.lib(XML.cpp.obj) : error LNK2019: unresolved external symbol __imp__xmlDocGetRootElement referenced in function "public: class lldb_private::XMLNode __thiscall lldb_private::XMLDocument::GetRootElement(char const *)" (?GetRootElement@XMLDocument@lldb_private@@QAE?AVXMLNode@2@PBD@Z)
lldbHost.lib(XML.cpp.obj) : error LNK2019: unresolved external symbol __imp__xmlGetProp referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall lldb_private::XMLNode::GetAttributeValue(char const *,char const *)const " (?GetAttributeValue@XMLNode@lldb_private@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBD0@Z)
lldbHost.lib(XML.cpp.obj) : error LNK2019: unresolved external symbol __imp__xmlSetGenericErrorFunc referenced in function "public: bool __thiscall lldb_private::XMLDocument::ParseFile(char const *)" (?ParseFile@XMLDocument@lldb_private@@QAE_NPBD@Z)
lldbHost.lib(XML.cpp.obj) : error LNK2019: unresolved external symbol __imp__xmlParseFile referenced in function "public: bool __thiscall lldb_private::XMLDocument::ParseFile(char const *)" (?ParseFile@XMLDocument@lldb_private@@QAE_NPBD@Z)
lldbHost.lib(XML.cpp.obj) : error LNK2019: unresolved external symbol __imp__xmlReadMemory referenced in function "public: bool __thiscall lldb_private::XMLDocument::ParseMemory(char const *,unsigned int,char const *)" (?ParseMemory@XMLDocument@lldb_private@@QAE_NPBDI0@Z)
lldbHost.lib(XML.cpp.obj) : error LNK2019: unresolved external symbol __imp__xmlFree referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall lldb_private::XMLNode::GetAttributeValue(char const *,char const *)const " (?GetAttributeValue@XMLNode@lldb_private@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBD0@Z)
D:\downloads\tools\perl\5.38.0.1\c\lib\libxml2.a : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
Currently running CI with --trace-expand and --debug-find to see what is going on.
Edited by Alexander Neumann