<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58345>58345</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            libomp.so.5 fails to link with `symbol omp_set_affinity_format_ has undefined version OMP_5.0`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            openmp,
            build-problem
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sylvestre
      </td>
    </tr>
</table>

<pre>
    Started to regress today:
```
FAILED: openmp/runtime/src/libomp.so.5 
: && "/build/llvm-toolchain-snapshot-16~++20221013034023+d8cab3f40707/build-llvm/./bin/clang" --target=x86_64-pc-linux-gnu -fPIC -fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -fno-semantic-interposition -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -ffile-prefix-map=/build/llvm-toolchain-snapshot-16~++20221013034023+d8cab3f40707/build-llvm/runtimes/runtimes-bins=build-llvm/runtimes/runtimes-bins -ffile-prefix-map=/build/llvm-toolchain-snapshot-16~++20221013034023+d8cab3f40707/= -no-canonical-prefixes -Wall -Wcast-qual -Wformat-pedantic -Wimplicit-fallthrough -Wsign-compare -Wno-enum-constexpr-conversion -Wno-extra -Wno-pedantic -O3 -DNDEBUG  -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--build-id -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=gold  -Wl,--warn-shared-textrel -Wl,--as-needed -static-libgcc -Wl,-z,noexecstack -shared -Wl,-soname,libomp.so.5 -o openmp/runtime/src/libomp.so.5 openmp/runtime/src/CMakeFiles/omp.dir/kmp_alloc.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_atomic.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_debug.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_itt.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_environment.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_error.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_global.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_i18n.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_io.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_runtime.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_settings.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_str.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_tasking.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_threadprivate.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_utility.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_barrier.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_wait_release.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_affinity.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_dispatch.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_lock.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_sched.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/z_Linux_util.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_gsupport.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/thirdparty/ittnotify/ittnotify_static.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_taskdeps.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_cancel.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_ftn_cdecl.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_ftn_extra.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/kmp_version.cpp.o openmp/runtime/src/CMakeFiles/omp.dir/z_Linux_asm.S.o  -lm  -ldl && cd "/build/llvm-toolchain-snapshot-16~++20221013034023+d8cab3f40707/build-llvm/runtimes/runtimes-bins/openmp/runtime/src" && /usr/bin/cmake -E create_symlink libomp.so.5 libgomp.so && /usr/bin/cmake -E create_symlink libomp.so.5 libiomp5.so
/usr/bin/ld.gold: error: symbol omp_set_affinity_format_ has undefined version VERSION
/usr/bin/ld.gold: error: symbol omp_set_affinity_format_ has undefined version OMP_5.0
/usr/bin/ld.gold: error: symbol GOMP_parallel has undefined version GOMP_4.0
/usr/bin/ld.gold: error: symbol omp_get_ancestor_thread_num_ has undefined version OMP_3.0
/usr/bin/ld.gold: error: symbol omp_get_partition_place_nums_ has undefined version OMP_4.5
/usr/bin/ld.gold: error: symbol omp_get_num_devices_ has undefined version OMP_4.0
/usr/bin/ld.gold: error: symbol omp_get_wtick_ has undefined version OMP_2.0
/usr/bin/ld.gold: error: symbol omp_in_final_ has undefined version OMP_3.1
/usr/bin/ld.gold: error: symbol omp_get_thread_num_ has undefined version OMP_1.0
/usr/bin/ld.gold: error: symbol GOMP_loop_ordered_start has undefined version GOMP_5.0
/usr/bin/ld.gold: error: symbol GOMP_parallel_loop_nonmonotonic_dynamic has undefined version GOMP_4.5
/usr/bin/ld.gold: error: symbol GOMP_single_start has undefined version GOMP_1.0
/usr/bin/ld.gold: error: symbol GOMP_loop_ull_ordered_runtime_next has undefined version GOMP_2.0
/usr/bin/ld.gold: error: symbol GOMP_taskyield has undefined version GOMP_3.0
/usr/bin/ld.gold: error: symbol GOMP_free has undefined version GOMP_5.0.1
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9WFtv2zYU_jX2i0DDlq958EOaSxGgbYpm3bAngSaPZC4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