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

    <tr>
        <th>Summary</th>
        <td>
            [libc] full build integration tests fails with `libm` during linking 
        </td>
    </tr>

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

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

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

<pre>
    ```
eate_test.libc.a && :
ld.lld: error: unable to find library -lm
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[8/18] Linking CXX executable projects/libc/test/integration/src/pthread/libc.test.integration.src.pthread.pthread_join_test.__build__
FAILED: projects/libc/test/integration/src/pthread/libc.test.integration.src.pthread.pthread_join_test.__build__ 
: && /usr/bin/clang++ -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 -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 -ffunction-sections -fdata-sections -O2 -g -DNDEBUG -fuse-ld=lld -Wl,--color-diagnostics    -nolibc -nostartfiles -nostdlib++ -static projects/libc/startup/linux/crt1.o projects/libc/test/IntegrationTest/CMakeFiles/libc.test.IntegrationTest.test.dir/test.cpp.o projects/libc/test/integration/src/pthread/CMakeFiles/libc.test.integration.src.pthread.pthread_join_test.__build__.dir/pthread_join_test.cpp.o -o projects/libc/test/integration/src/pthread/libc.test.integration.src.pthread.pthread_join_test.__build__ projects/libc/test/integration/src/pthread/liblibc.test.integration.src.pthread.pthread_join_test.libc.a && :
ld.lld: error: unable to find library -lm
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[9/18] Linking CXX executable projects/libc/test/integration/src/pthread/libc.test.integration.src.pthread.pthread_test.__build__
FAILED: projects/libc/test/integration/src/pthread/libc.test.integration.src.pthread.pthread_test.__build__ 
: && /usr/bin/clang++ -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 -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 -ffunction-sections -fdata-sections -O2 -g -DNDEBUG -fuse-ld=lld -Wl,--color-diagnostics    -nolibc -nostartfiles -nostdlib++ -static projects/libc/startup/linux/crt1.o projects/libc/test/IntegrationTest/CMakeFiles/libc.test.IntegrationTest.test.dir/test.cpp.o projects/libc/test/integration/src/pthread/CMakeFiles/libc.test.integration.src.pthread.pthread_test.__build__.dir/pthread_test.cpp.o -o projects/libc/test/integration/src/pthread/libc.test.integration.src.pthread.pthread_test.__build__ projects/libc/test/integration/src/pthread/liblibc.test.integration.src.pthread.pthread_test.libc.a && :
ld.lld: error: unable to find library -lm
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsV02P2zYT_jXyhRhBpj_WPviwu45fBMjbFmgLB70sKHIkT0KRKjn07vbXF5S0jdMmOWyBLgIsIJgWNTPPPPPBAVWM1DrEXbG6KVb7mUp88mH3sz4Fb8i1GH47pVntzeOuWFfTU-2L6hoV4x1j5NJSrUslCrku5FoUi-tRwJrSWlMsrgWG4EP-k5yqLQr2oiFnhKU6qPAowHajirbKtYW8yc-lniX3EYPQvuuUM6JRZNGIe-KTwAdiob1BMReF3KSIAs4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