<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65433>65433</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[openmp] Build fail as LLVM runtime with CLANG_DEFAULT_RTLIB=compiler-rt in 17.0.0-rc4
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vient
</td>
</tr>
</table>
<pre>
Pretty much as title says, run something like
```shell
cmake -G Ninja "${LLVM_PROJECT_DIR}/llvm" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCLANG_DEFAULT_LINKER=lld \
-DCLANG_DEFAULT_RTLIB=compiler-rt \
-DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-pc-linux-gnu" \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DLLVM_ENABLE_PROJECTS='clang;lld' \
-DLLVM_ENABLE_RUNTIMES='compiler-rt;openmp' \
-DLLVM_USE_LINKER=lld \
-DLLVM_CCACHE_BUILD=ON
ninja
```
and get
```console
[2685/2740] Linking CXX shared library openmp/libompd/src/libompd.so
FAILED: openmp/libompd/src/libompd.so
: && /test/work/stage1/./bin/clang++ --target=x86_64-pc-linux-gnu -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -Wcast-qual -Wformat-pedantic -Wimplicit-fallthrough -Wsign-compare -Wno-enum-constexpr-conversion -Wno-extra -Wno-pedantic -std=c++11 -O3 -DNDEBUG -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=lld -Wl,--color-diagnostics -shared -Wl,-soname,libompd.so -o openmp/libompd/src/libompd.so openmp/libompd/src/CMakeFiles/ompd.dir/TargetValue.cpp.o openmp/libompd/src/CMakeFiles/ompd.dir/omp-debug.cpp.o openmp/libompd/src/CMakeFiles/ompd.dir/omp-state.cpp.o openmp/libompd/src/CMakeFiles/ompd.dir/omp-icv.cpp.o -Wl,-rpath,/test/work/stage1/runtimes/runtimes-bins/openmp/runtime/src: openmp/runtime/src/libomp.so -lpthread -lrt -lm -ldl && :
ld.lld: error: undefined symbol: _Unwind_Resume
>>> referenced by TargetValue.cpp
>>> openmp/libompd/src/CMakeFiles/ompd.dir/TargetValue.cpp.o:(TTypeFactory::getType(_ompd_aspace_cont*, char const*, unsigned long))
>>> referenced by TargetValue.cpp
>>> openmp/libompd/src/CMakeFiles/ompd.dir/TargetValue.cpp.o:(TTypeFactory::getType(_ompd_aspace_cont*, char const*, unsigned long))
>>> referenced by TargetValue.cpp
>>> openmp/libompd/src/CMakeFiles/ompd.dir/TargetValue.cpp.o:(TTypeFactory::getType(_ompd_aspace_cont*, char const*, unsigned long))
>>> referenced 20 more times
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[2693/2740] Building CXX object compiler-rt/lib/memprof/tests/CMakeFiles/MemProfUnitTests.dir/test/work/llvm-project/third-party/unittest/googletest/src/gtest-all.cc.o
ninja: build stopped: subcommand failed.
FAILED: runtimes/runtimes-stamps/runtimes-build /test/work/stage1/runtimes/runtimes-stamps/runtimes-build
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsV82S6roRfhqxUYkCmd8FC7DxCbnMT3GYO5MVJVttW3dkyZFkZrhPn5JtZoB7pnKSs0ulymWQ9HWr-1N3u8WsFbkCWKDxCo2jHqtdoc3iKEC5XqL5afFowLkTLuu0wMxiJ5wEbNnJIhpiUytsdQmuECrHUrwCGkRosESTQfvYAqRs59K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