<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/109328>109328</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang][Unittests] - Linker failure in clang unittests for Clang driver
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bhandarkar-pranav
</td>
</tr>
</table>
<pre>
I am getting the following build error
```
FAILED: tools/clang/unittests/Driver/ClangDriverTests
: && /usr/bin/c++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG -Wl,--gc-sections tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/DistroTest.cpp.o tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/DXCModeTest.cpp.o tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/GCCVersionTest.cpp.o tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/ToolChainTest.cpp.o tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/ModuleCacheTest.cpp.o tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/MultilibBuilderTest.cpp.o tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/MultilibTest.cpp.o tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/SanitizerArgsTest.cpp.o -o tools/clang/unittests/Driver/ClangDriverTests -Wl,-rpath,/home/prbhanda/git/bhandarkar-pranav/build/build-12Sep24/lib lib/libLLVMX86CodeGen.so.20.0git lib/libLLVMX86AsmParser.so.20.0git lib/libLLVMX86Desc.so.20.0git lib/libLLVMX86Disassembler.so.20.0git lib/libLLVMX86Info.so.20.0git lib/libLLVMAMDGPUCodeGen.so.20.0git lib/libLLVMAMDGPUAsmParser.so.20.0git lib/libLLVMAMDGPUDisassembler.so.20.0git lib/libLLVMNVPTXCodeGen.so.20.0git lib/libLLVMNVPTXDesc.so.20.0git lib/libLLVMNVPTXInfo.so.20.0git lib/libllvm_gtest_main.so.20.0git lib/libllvm_gtest.so.20.0git lib/libclangFrontend.so.20.0git lib/libLLVMAMDGPUDesc.so.20.0git lib/libLLVMAMDGPUInfo.so.20.0git lib/libLLVMAMDGPUUtils.so.20.0git lib/libclangDriver.so.20.0git lib/libLLVMOption.so.20.0git lib/libclangBasic.so.20.0git lib/libLLVMMC.so.20.0git lib/libLLVMTargetParser.so.20.0git lib/libLLVMSupport.so.20.0git -Wl,-rpath-link,/home/prbhanda/git/bhandarkar-pranav/build/build-12Sep24/lib && :
/usr/bin/ld: tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/ToolChainTest.cpp.o: undefined reference to symbol '_ZN5clang22PCHContainerOperationsC1Ev'
/usr/bin/ld: /home/prbhanda/git/bhandarkar-pranav/build/build-12Sep24/lib/libclangSerialization.so.20.0git: error adding symbols: DSO missing from command line
```
I build with `BUILD_SHARED_LIBS=ON`. It started with this commit https://github.com/llvm/llvm-project/commit/d1335fb86466221b0499db5fc8f158f1f64d9542
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0V1tv2zwS_TX0C0FDpnx98IMtxamB3LBJ6mJfAkocSbOhSC1JuU1__YKSc2kap9kPDRBE5ujMmYuG4pFwDksNsCSTNZmkA9H6ythlVgkthb0XljVWaLEfZEY-LLdU1LQE71GX1FdAC6OU-R5WWYtKUrDWWBKlJFqRaXT465ab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