<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/69056>69056</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
linker error in a new llvm build
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mbelda
</td>
</tr>
</table>
<pre>
I am installing llvm in a clean build and I got a linker error when building it.
I have configured it with the following options.
~~~
cmake -S llvm -B build -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;compiler-rt;polly" -DCMAKE_BUILD_TYPE=Release
~~~
And then when building it executing `cmake --build build` the following error appears.
~~~
[ 52%] Building CXX object projects/compiler-rt/lib/ubsan/CMakeFiles/RTUbsan.x86_64.dir/ubsan_value.cpp.o
[ 52%] Built target RTUbsan.x86_64
[ 52%] Building CXX object projects/compiler-rt/lib/ubsan/CMakeFiles/clang_rt.ubsan_standalone-x86_64.dir/ubsan_init_standalone_preinit.cpp.o
[ 52%] Linking CXX static library ../../../../lib/clang/18/lib/x86_64-unknown-linux-gnu/libclang_rt.ubsan_standalone.a
[ 52%] Built target clang_rt.ubsan_standalone-x86_64
[ 52%] Generating version list for clang_rt.ubsan_standalone-dynamic-x86_64
[ 52%] Building CXX object projects/compiler-rt/lib/ubsan/CMakeFiles/RTUbsan_dynamic_version_script_dummy.x86_64.dir/dummy.cpp.o
[ 52%] Built target RTUbsan_dynamic_version_script_dummy.x86_64
[ 52%] Linking CXX shared library ../../../../lib/clang/18/lib/x86_64-unknown-linux-gnu/libclang_rt.ubsan_standalone.so
/usr/bin/ld: CMakeFiles/RTUbsan_cxx.x86_64.dir/ubsan_type_hash_itanium.cpp.o: in function `findBaseAtOffset(__cxxabiv1::__class_type_info const*, long)':
/home/mbelda/epfl/llvm-project/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:174: undefined reference to `typeinfo for __cxxabiv1::__si_class_type_info'
/usr/bin/ld: /home/mbelda/epfl/llvm-project/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:174: undefined reference to `typeinfo for __cxxabiv1::__class_type_info'
/usr/bin/ld: /home/mbelda/epfl/llvm-project/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:174: undefined reference to `__dynamic_cast'
/usr/bin/ld: /home/mbelda/epfl/llvm-project/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:178: undefined reference to `typeinfo for __cxxabiv1::__vmi_class_type_info'
/usr/bin/ld: /home/mbelda/epfl/llvm-project/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:178: undefined reference to `__dynamic_cast'
/usr/bin/ld: CMakeFiles/RTUbsan_cxx.x86_64.dir/ubsan_type_hash_itanium.cpp.o: in function `isDerivedFromAtOffset(__cxxabiv1::__class_type_info const*, __cxxabiv1::__class_type_info const*, long)':
/home/mbelda/epfl/llvm-project/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:137: undefined reference to `typeinfo for __cxxabiv1::__si_class_type_info'
/usr/bin/ld: /home/mbelda/epfl/llvm-project/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:137: undefined reference to `typeinfo for __cxxabiv1::__class_type_info'
/usr/bin/ld: /home/mbelda/epfl/llvm-project/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:137: undefined reference to `__dynamic_cast'
/usr/bin/ld: /home/mbelda/epfl/llvm-project/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:141: undefined reference to `typeinfo for __cxxabiv1::__vmi_class_type_info'
/usr/bin/ld: /home/mbelda/epfl/llvm-project/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:141: undefined reference to `typeinfo for __cxxabiv1::__class_type_info'
/usr/bin/ld: /home/mbelda/epfl/llvm-project/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:141: undefined reference to `__dynamic_cast'
/usr/bin/ld: CMakeFiles/RTUbsan_cxx.x86_64.dir/ubsan_type_hash_itanium.cpp.o: in function `__ubsan::checkDynamicType(void*, void*, unsigned long)':
/home/mbelda/epfl/llvm-project/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:245: undefined reference to `typeinfo for __cxxabiv1::__class_type_info'
/usr/bin/ld: /home/mbelda/epfl/llvm-project/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:245: undefined reference to `typeinfo for std::type_info'
/usr/bin/ld: /home/mbelda/epfl/llvm-project/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:245: undefined reference to `__dynamic_cast'
collect2: error: ld returned 1 exit status
make[2]: *** [projects/compiler-rt/lib/ubsan/CMakeFiles/clang_rt.ubsan_standalone-dynamic-x86_64.dir/build.make:257: lib/clang/18/lib/x86_64-unknown-linux-gnu/libclang_rt.ubsan_standalone.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:38979: projects/compiler-rt/lib/ubsan/CMakeFiles/clang_rt.ubsan_standalone-dynamic-x86_64.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
~~~
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcmF2P2joTxz-NubESEYcQcsFFWDbVPs_2tGq3Rz1XkRNPiA-OHdkOCzf97EdOYLtsoXt6-kolFIzxDP_fZGZQhhrDVxJgjqIFipYj2tla6XlTgGB0VCi2m99g2mAujaVCcLnCQmzcZ0xxKYBKXHRcMEwlwzd4pSymWHC5Bo1Ba6XxfQ37M86YWx-Nl2icDtcbXNMN4FLJiq86DQxzi--5rbGtAVdKCHXvzFRruZJmb_vhw4dhUTZ0Ddh7O2jyFnst3guMCHkn-Ra_pGuouACDCMHe8vb2z5f59R_p4vY6f_3m1f-ur-7eonCJCCkFlSsULvp3zyoljAdbq6nbU03LBWhPWxQuWiXEbnB39TL9_3W-eHdzu8zv_np9jcLlGxBADTwIxcMqlcwhyU_CgWELZWfdBzQd74G8gaO_oun4STCGuNK2BarNUTgfAoOiBY4IIhGKln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