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

    <tr>
        <th>Summary</th>
        <td>
            [libc] Missing `thread` to `libc.include.fcntl` dependency in full build
        </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>
    ```
UG -std=c++17 -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -O3 -Wno-frame-address -MD -MT projects/libc/src/__support/threads/linux/CMakeFiles/libc.src.__support.threads.linux.thread.dir/thread.cpp.o -MF projects/libc/src/__support/threads/linux/CMakeFiles/libc.src.__support.threads.linux.thread.dir/thread.cpp.o.d -o projects/libc/src/__support/threads/linux/CMakeFiles/libc.src.__support.threads.linux.thread.dir/thread.cpp.o -c /home/yifanzhu/llvm-project/libc/src/__support/threads/linux/thread.cpp
In file included from /home/yifanzhu/llvm-project/libc/src/__support/threads/linux/thread.cpp:24:
In file included from /usr/include/fcntl.h:75:
/usr/include/bits/types/struct_timespec.h:11:8: error: redefinition of 'timespec'
   11 | struct timespec
      | ^
/home/yifanzhu/llvm-project/libc/include/llvm-libc-types/struct_timespec.h:14:8: note: previous definition is here
   14 | struct timespec {
      | ^
1 error generated.
[237/338] Building CXX object projects/lib
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVU-PuzYQ_TTOZWQENoTkwCHZlGqlX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