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

    <tr>
        <th>Summary</th>
        <td>
            [libc][test] link error running pthreads tests on linux, x86_64
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc
      </td>
    </tr>

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

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

<pre>
    getting the follow error running `ninja check-libc` on latest. think some `LINK_LIBRARIES` just needs to be added to the pthreads test cmake file? will make a PR for this

```
/usr/bin/clang++ -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -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 -g projects/libc/test/src/pthread/CMakeFiles/libc.test.src.pthread.pthread_condattr_test.__build__.dir/pthread_condattr_test.cpp.o -o projects/libc/test/src/pthread/libc.test.src.pthread.pthread_condattr_test.__build__ projects/libc/src/pthread/CMakeFiles/libc.src.pthread.pthread_condattr_destroy.__internal__.dir/./pthread_condattr_destroy.cpp.o projects/libc/src/pthread/CMakeFiles/libc.src.pthread.pthread_condattr_getclock.__internal__.dir/./pthread_condattr_getclock.cpp.o projects/libc/src/pthread/CMakeFiles/libc.src.pthread.pthread_condattr_getpshared.__internal__.dir/./pthread_condattr_getpshared.cpp.o projects/libc/src/pthread/CMakeFiles/libc.src.pthread.pthread_condattr_init.__internal__.dir/./pthread_condattr_init.cpp.o projects/libc/src/pthread/CMakeFiles/libc.src.pthread.pthread_condattr_setclock.__internal__.dir/./pthread_condattr_setclock.cpp.o projects/libc/src/pthread/CMakeFiles/libc.src.pthread.pthread_condattr_setpshared.__internal__.dir/./pthread_condattr_setpshared.cpp.o projects/libc/src/__support/StringUtil/CMakeFiles/libc.src.__support.StringUtil.error_to_string.dir/./error_to_string.cpp.o projects/libc/src/__support/OSUtil/linux/CMakeFiles/libc.src.__support.OSUtil.linux.linux_util.dir/./quick_exit.cpp.o projects/libc/src/errno/CMakeFiles/libc.src.errno.errno.__internal__.dir/./libc_errno.cpp.o lib/libLibcDeathTestExecutors.unit.a  lib/libLibcTest.unit.a
/usr/bin/ld: projects/libc/test/src/pthread/CMakeFiles/libc.test.src.pthread.pthread_condattr_test.__build__.dir/pthread_condattr_test.cpp.o: in function `LlvmLibcPThreadCondAttrTest_GetDefaultValues::Run()':
/home/seclab/repos/llvm-project/libc/test/src/pthread/pthread_condattr_test.cpp:30: undefined reference to `pthread_condattr_getclock'
/usr/bin/ld: /home/seclab/repos/llvm-project/libc/test/src/pthread/pthread_condattr_test.cpp:32: undefined reference to `pthread_condattr_getpshared'
/usr/bin/ld: projects/libc/test/src/pthread/CMakeFiles/libc.test.src.pthread.pthread_condattr_test.__build__.dir/pthread_condattr_test.cpp.o: in function `LlvmLibcPThreadCondAttrTest_SetGoodValues::Run()':
/home/seclab/repos/llvm-project/libc/test/src/pthread/pthread_condattr_test.cpp:46: undefined reference to `pthread_condattr_setclock'
/usr/bin/ld: /home/seclab/repos/llvm-project/libc/test/src/pthread/pthread_condattr_test.cpp:47: undefined reference to `pthread_condattr_getclock'
/usr/bin/ld: /home/seclab/repos/llvm-project/libc/test/src/pthread/pthread_condattr_test.cpp:49: undefined reference to `pthread_condattr_setpshared'
/usr/bin/ld: /home/seclab/repos/llvm-project/libc/test/src/pthread/pthread_condattr_test.cpp:50: undefined reference to `pthread_condattr_getpshared'
/usr/bin/ld: projects/libc/test/src/pthread/CMakeFiles/libc.test.src.pthread.pthread_condattr_test.__build__.dir/pthread_condattr_test.cpp.o: in function `LlvmLibcPThreadCondAttrTest_SetBadValues::Run()':
/home/seclab/repos/llvm-project/libc/test/src/pthread/pthread_condattr_test.cpp:64: undefined reference to `pthread_condattr_setclock'
/usr/bin/ld: /home/seclab/repos/llvm-project/libc/test/src/pthread/pthread_condattr_test.cpp:65: undefined reference to `pthread_condattr_getclock'
/usr/bin/ld: /home/seclab/repos/llvm-project/libc/test/src/pthread/pthread_condattr_test.cpp:67: undefined reference to `pthread_condattr_setpshared'
/usr/bin/ld: /home/seclab/repos/llvm-project/libc/test/src/pthread/pthread_condattr_test.cpp:68: undefined reference to `pthread_condattr_getpshared'
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWF9PGz8W_TTOi-Uo8SQhecgDkF8qtN3dCrrL48ix78zc4rGn9nWA_fQrz4TSdqGFqlSgldDA2Oden-P7Z4xVjFg7gDWbn7D5ZqQSNT6st1Y5gw5HO29u1zUQoas5NcArb62_5hCCDzwk5_IEW0wcuk-K6wb0lbC402wx4d5xqwgijTk16K549C1k8Puzf_ytfH92cn58fvbXRYZ-SpG4AzCRk-c74MoYMPnvvGhHTQCV5yAS1626Al6hBVZs-TVay_sRxT-c88qHvFhkkw2bHB-ei8nhZ3iV2xQDk9sdOia32ipXM3nC5AkX1YezUy6qPUbcoUW6FegsOoiiQWPAcXHZS2fFxigCQdjCV2PJ1UkFA0aovUKrDj4cXHNxqazN0BsKiotL50VyKYIRnQqqBYLAxeV1QAIRKaCrIxeXWkUSn5PKli3GiK4WFYI1Ah0SKov_gRC56MAoR6gHx9a7un9kD4O01VJo33aKRE9ARGiRi0tsO4saSVTKWmqCT3WTjfweAhgRr5F0IwxUKlkanDsPNxo6EnTbQT_kxB4DJWWFIZ9VGLBAIB6YiamuIZLI_gOabD-IFdq7PYSI3g1SLSiTx9EZcKRomNCkjGjV7Q5EcjF1nQ8EhovKoKqdj4Q6Cu1tXqzmXfCfQFNkctvnpNzmBGJyG0N-OaQVk9vTv6sr2KKFO-i4T9sY9PgAuvtdau-MIgpljyjLXUJrynJsMNy7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