<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64263>64263</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
windows release packaging fails to link c-index-test due to unresolved libxml2 symbols
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
zmodem
</td>
</tr>
</table>
<pre>
Build steps (in a VS2019 cmd prompt) that used to work at `llvmorg-17-init` but fails at `llvmorg-18-init`. This is based on what `build_llvm_package.bat` does, see https://discourse.llvm.org/t/llvm-17-0-0-rc1-tagged/72404/3?u=hansw2000
```
curl -O https://gitlab.gnome.org/GNOME/libxml2/-/archive/v2.9.12/libxml2-v2.9.12.tar.gz
tar zxf libxml2-v2.9.12.tar.gz
mkdir libxmlbuild && cd libxmlbuild
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install ^
-DBUILD_SHARED_LIBS=OFF -DLIBXML2_WITH_C14N=OFF -DLIBXML2_WITH_CATALOG=OFF ^
-DLIBXML2_WITH_DEBUG=OFF -DLIBXML2_WITH_DOCB=OFF -DLIBXML2_WITH_FTP=OFF ^
-DLIBXML2_WITH_HTML=OFF -DLIBXML2_WITH_HTTP=OFF -DLIBXML2_WITH_ICONV=OFF ^
-DLIBXML2_WITH_ICU=OFF -DLIBXML2_WITH_ISO8859X=OFF -DLIBXML2_WITH_LEGACY=OFF ^
-DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_MEM_DEBUG=OFF -DLIBXML2_WITH_MODULES=OFF ^
-DLIBXML2_WITH_OUTPUT=ON -DLIBXML2_WITH_PATTERN=OFF -DLIBXML2_WITH_PROGRAMS=OFF ^
-DLIBXML2_WITH_PUSH=OFF -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_READER=OFF ^
-DLIBXML2_WITH_REGEXPS=OFF -DLIBXML2_WITH_RUN_DEBUG=OFF -DLIBXML2_WITH_SAX1=OFF ^
-DLIBXML2_WITH_SCHEMAS=OFF -DLIBXML2_WITH_SCHEMATRON=OFF -DLIBXML2_WITH_TESTS=OFF ^
-DLIBXML2_WITH_THREADS=ON -DLIBXML2_WITH_THREAD_ALLOC=OFF -DLIBXML2_WITH_TREE=ON ^
-DLIBXML2_WITH_VALID=OFF -DLIBXML2_WITH_WRITER=OFF -DLIBXML2_WITH_XINCLUDE=OFF ^
-DLIBXML2_WITH_XPATH=OFF -DLIBXML2_WITH_XPTR=OFF -DLIBXML2_WITH_ZLIB=OFF ^
../libxml2-v2.9.12 && ninja install
set libxmldir=%cd%\install
set "libxmldir=%libxmldir:\=/%"
cd ..
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_LIBXML2=FORCE_ON -DCMAKE_C_FLAGS="-DLIBXML_STATIC" -DCMAKE_CXX_FLAGS="-DLIBXML_STATIC" -DLLVM_ENABLE_PROJECTS="clang" -DLIBXML2_INCLUDE_DIRS=%libxmldir%/include/libxml2 -DLIBXML2_LIBRARIES=%libxmldir%/lib/libxml2s.lib ../llvm
ninja c-index-test
[3680/3680] Linking CXX executable bin\c-index-test.exe
FAILED: bin/c-index-test.exe
cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\clang\tools\c-index-test\CMakeFiles\c-index-test.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests -- C:\PROGRA~2\MICROS~2\2019\PROFES~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo tools\clang\tools\c-index-test\CMakeFiles\c-index-test.dir\c-index-test.c.obj tools\clang\tools\c-index-test\CMakeFiles\c-index-test.dir\core_main.cpp.obj tools\clang\tools\c-index-test\CMakeFiles\c-index-test.dir\C_\src\llvm-project\llvm\resources\windows_version_resource.rc.res /out:bin\c-index-test.exe /implib:lib\c-index-test.lib /pdb:bin\c-index-test.pdb /version:0.0 /machine:x64 /STACK:10000000 /INCREMENTAL:NO /subsystem:console lib\LLVMSupport.lib lib\libclang.lib lib\clangAST.lib lib\clangBasic.lib lib\clangCodeGen.lib lib\clangFrontend.lib lib\clangIndex.lib lib\clangSerialization.lib libxmlbuild\install\lib\libxml2s.lib lib\LLVMCoverage.lib lib\LLVMLTO.lib lib\LLVMExtensions.lib lib\LLVMPasses.lib lib\LLVMCoroutines.lib lib\LLVMipo.lib lib\LLVMLinker.lib lib\LLVMIRPrinter.lib lib\LLVMInstrumentation.lib lib\LLVMVectorize.lib lib\LLVMCodeGen.lib lib\LLVMBitWriter.lib lib\LLVMCodeGenTypes.lib lib\LLVMObjCARCOpts.lib lib\LLVMTarget.lib lib\clangFrontend.lib lib\clangDriver.lib version.lib lib\LLVMWindowsDriver.lib lib\clangParse.lib lib\LLVMOption.lib lib\clangSerialization.lib lib\clangSema.lib lib\clangAnalysis.lib lib\clangASTMatchers.lib lib\LLVMFrontendHLSL.lib lib\clangEdit.lib lib\clangAST.lib lib\LLVMFrontendOpenMP.lib lib\LLVMScalarOpts.lib lib\LLVMAggressiveInstCombine.lib lib\LLVMInstCombine.lib lib\LLVMTransformUtils.lib lib\LLVMAnalysis.lib lib\LLVMProfileData.lib lib\LLVMSymbolize.lib lib\LLVMDebugInfoPDB.lib "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\DIA SDK\lib\amd64\diaguids.lib" lib\LLVMDebugInfoMSF.lib lib\LLVMDebugInfoBTF.lib lib\LLVMDebugInfoDWARF.lib lib\LLVMObject.lib lib\LLVMIRReader.lib lib\LLVMBitReader.lib lib\LLVMAsmParser.lib lib\LLVMMCParser.lib lib\LLVMMC.lib lib\LLVMDebugInfoCodeView.lib lib\LLVMTextAPI.lib lib\clangSupport.lib lib\LLVMCore.lib lib\LLVMBinaryFormat.lib lib\LLVMRemarks.lib lib\LLVMBitstreamReader.lib lib\clangFormat.lib lib\clangToolingInclusions.lib lib\clangToolingCore.lib lib\clangRewrite.lib lib\clangLex.lib lib\clangBasic.lib lib\LLVMTargetParser.lib lib\LLVMSupport.lib psapi.lib shell32.lib ole32.lib uuid.lib advapi32.lib delayimp.lib -delayload:shell32.dll -delayload:ole32.dll lib\LLVMDemangle.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK: command "C:\PROGRA~2\MICROS~2\2019\PROFES~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo tools\clang\tools\c-index-test\CMakeFiles\c-index-test.dir\c-index-test.c.obj tools\clang\tools\c-index-test\CMakeFiles\c-index-test.dir\core_main.cpp.obj tools\clang\tools\c-index-test\CMakeFiles\c-index-test.dir\C_\src\llvm-project\llvm\resources\windows_version_resource.rc.res /out:bin\c-index-test.exe /implib:lib\c-index-test.lib /pdb:bin\c-index-test.pdb /version:0.0 /machine:x64 /STACK:10000000 /INCREMENTAL:NO /subsystem:console lib\LLVMSupport.lib lib\libclang.lib lib\clangAST.lib lib\clangBasic.lib lib\clangCodeGen.lib lib\clangFrontend.lib lib\clangIndex.lib lib\clangSerialization.lib libxmlbuild\install\lib\libxml2s.lib lib\LLVMCoverage.lib lib\LLVMLTO.lib lib\LLVMExtensions.lib lib\LLVMPasses.lib lib\LLVMCoroutines.lib lib\LLVMipo.lib lib\LLVMLinker.lib lib\LLVMIRPrinter.lib lib\LLVMInstrumentation.lib lib\LLVMVectorize.lib lib\LLVMCodeGen.lib lib\LLVMBitWriter.lib lib\LLVMCodeGenTypes.lib lib\LLVMObjCARCOpts.lib lib\LLVMTarget.lib lib\clangFrontend.lib lib\clangDriver.lib version.lib lib\LLVMWindowsDriver.lib lib\clangParse.lib lib\LLVMOption.lib lib\clangSerialization.lib lib\clangSema.lib lib\clangAnalysis.lib lib\clangASTMatchers.lib lib\LLVMFrontendHLSL.lib lib\clangEdit.lib lib\clangAST.lib lib\LLVMFrontendOpenMP.lib lib\LLVMScalarOpts.lib lib\LLVMAggressiveInstCombine.lib lib\LLVMInstCombine.lib lib\LLVMTransformUtils.lib lib\LLVMAnalysis.lib lib\LLVMProfileData.lib lib\LLVMSymbolize.lib lib\LLVMDebugInfoPDB.lib C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\DIA SDK\lib\amd64\diaguids.lib lib\LLVMDebugInfoMSF.lib lib\LLVMDebugInfoBTF.lib lib\LLVMDebugInfoDWARF.lib lib\LLVMObject.lib lib\LLVMIRReader.lib lib\LLVMBitReader.lib lib\LLVMAsmParser.lib lib\LLVMMCParser.lib lib\LLVMMC.lib lib\LLVMDebugInfoCodeView.lib lib\LLVMTextAPI.lib lib\clangSupport.lib lib\LLVMCore.lib lib\LLVMBinaryFormat.lib lib\LLVMRemarks.lib lib\LLVMBitstreamReader.lib lib\clangFormat.lib lib\clangToolingInclusions.lib lib\clangToolingCore.lib lib\clangRewrite.lib lib\clangLex.lib lib\clangBasic.lib lib\LLVMTargetParser.lib lib\LLVMSupport.lib psapi.lib shell32.lib ole32.lib uuid.lib advapi32.lib delayimp.lib -delayload:shell32.dll -delayload:ole32.dll lib\LLVMDemangle.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:bin\c-index-test.exe.manifest" failed (exit code 1120) with the following output:
Creating library lib\c-index-test.lib and object lib\c-index-test.exp
c-index-test.c.obj : error LNK2019: unresolved external symbol xmlParseDoc referenced in function PrintCursorComments
c-index-test.c.obj : error LNK2019: unresolved external symbol xmlRelaxNGNewParserCtxt referenced in function PrintCursorComments
c-index-test.c.obj : error LNK2019: unresolved external symbol xmlRelaxNGFreeParserCtxt referenced in function PrintCursorComments
c-index-test.c.obj : error LNK2019: unresolved external symbol xmlRelaxNGParse referenced in function PrintCursorComments
c-index-test.c.obj : error LNK2019: unresolved external symbol xmlRelaxNGFree referenced in function PrintCursorComments
c-index-test.c.obj : error LNK2019: unresolved external symbol xmlRelaxNGNewValidCtxt referenced in function PrintCursorComments
c-index-test.c.obj : error LNK2019: unresolved external symbol xmlRelaxNGFreeValidCtxt referenced in function PrintCursorComments
c-index-test.c.obj : error LNK2019: unresolved external symbol xmlRelaxNGValidateDoc referenced in function PrintCursorComments
bin\c-index-test.exe : fatal error LNK1120: 8 unresolved externals
ninja: build stopped: subcommand failed.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWktzm7rb_zTKRmMPhth1FllgLglv8WWApDln4xEg22oE8kgicbroZ39HgG0CdtLk9D89i9PpONZz03ORHv1kQEKQdY7xNRhOwNC-QIXcMH79I2Mpzi5ilr5cTwpCUygk3goI9DHJIYL3oa4NrmCSpXDLWbaVQL-CcoMkLAROoWTwmfFHiCQEI43Sp4zxdW_wpUdyIsFIg3Eh4QoRKtoi471IH0YbIiARMEbKJMvh86YSjpVDS6Wy3KLkEa1xP0al2ZRhAXQLCozhRsqtAIYJdBfobkpEwgoucF_p9RlfA92VQHfVUHmm9bQeTwY9idZrnALd_aJfapdAdw1guAUw7A3KxbOuaRrQbKCZ9edIq_-Xw6TgFPbmrbnXRFIU99c5y3A9881sPnXU7CTeZVQHutsDuot4siFPGOjuk96_6g_0o0SvpvQl4v31j2o6iTj8sVvBt2Syx5TwWqJMHAT6COgjmKRNau1_hh4x7N3MSP4dwZ5tTc2vznJy5_n2Mvpr4QDDDjDFSOAD05uFken7y0XguN4DMGySC4kohWDoVEZhz64shLdm4NhL35uEwLDnrgt7tu9NHqa-vvzmRbdLa3A5O8MxI9Of39TMo-m2nO1M7m5Om7Dn1uQ0x40W7xq-jab-ae3b6KDe4njWfHb_rmXPujujHs7H4-HVw2mu79yY1l8d622pv6fmaf2pM30rW9O5fec74bvez--ixV2kxGZt1sKMIic4U9BFML8JzG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