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

    <tr>
        <th>Summary</th>
        <td>
            [libc] Compiler intrinsic headers indirectly pull in public libc headers
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          michaelrj-google
      </td>
    </tr>
</table>

<pre>
    As we work to make our header inclusions more hermetic, we are encountering unexpected places where public headers are indirectly included.

Specifically, while moving the epoll functions to a more hermetic design, I ran into an issue where our `sigset_t` conflicts with the system's in overlay mode tests, due to a very long include chain (copied below). We will need to find a solution to this problem eventually.

```
In file included from ~/llvm-project/libc/test/src/sys/epoll/linux/epoll_pwait_test.cpp:16:
In file included from ~/llvm-project/libc/test/UnitTest/ErrnoSetterMatcher.h:13:
In file included from ~/llvm-project/libc/src/__support/FPUtil/fpbits_str.h:12:
In file included from ~/llvm-project/libc/src/__support/CPP/string.h:14:
In file included from ~/llvm-project/libc/src/string/memory_utils/inline_memcpy.h:22:
In file included from ~/llvm-project/libc/src/string/memory_utils/x86_64/inline_memcpy.h:15:
In file included from ~/llvm-project/libc/src/string/memory_utils/op_x86.h:25:
In file included from /usr/lib/llvm-16/lib/clang/16/include/immintrin.h:26:
In file included from /usr/lib/llvm-16/lib/clang/16/include/xmmintrin.h:31:
In file included from /usr/lib/llvm-16/lib/clang/16/include/mm_malloc.h:13:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/stdlib.h:36:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/cstdlib:79:
In file included from /usr/include/stdlib.h:395:
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179:
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:33:
/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h:7:20: error: typedef redefinition with different types ('__sigset_t' vs 'struct sigset_t')
```

CC: @gchatelet @nickdesaulniers 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vs2O2zgMfhrlQkzgyLHjHHJIpxughwUG6BZ7NBSZjtmRJUOSk8lln31BOZmfbYsOZnYAQ5Bkkh8_ShSpQqCDRdyI4pMoPs_UGDvnNz3pTqHx328Ozh0MzvauOW-2AU4IJ-fvITro1T2CGz10qBr0QFabMZCzAXrnETr0PUbSQt6ymvIIaLUbbURP9gCjxYcBdcQGBqM0Bjh16BGGcW9IX6yGpEe2IY86mvOE0mAzF9lnkW2n8euAmlrSyphzguvIIPTuyDixQ8DBGQPtaHVMDkYH6qWX0CBHgrW_gFcWyLKQBQphxItrzFaUWaBDwFhHUWagnW0N6RjgRLFLYOEcIvZCrgKQBXdEb9QZetcgRAwxMEYz4uTEEf0ZjLOHKzPQnSILQlbaDYQN7NG4k5DrOfyNcCJjwCI2rN2SbUBBcGZkWrwVOwoweLc32AMe0caRg_IiWqLMLl9afrHQcriukYXWux7-EXJnzLG_Gbz7jjrykvZayB1zEHIXPC_COQi5S-FNEnZ8uK7r4aQo1iw-18Mg8u2iFPn2XaDfLMW_pukf3lv3FWNE_6eKukM_7xgjfzPGxKiuwzgMzvOP3d23SEysHfYUQx3iBUT-jyC3d3e8HzkpJuvLd1qfbAm567F3_lyPkQwfE1lDFuseez2cE5R8L5FfQT1UZV0uf4q5KD4I0w31Q1VOvH6HIeRuDH6yfIVblI9rbVRCSFsXTZ71PVlGn0B-d53fBvLwAiRffAhI39e9Msbp1yXNI8ierJC7-fzR_kHrx-O-Sfl_c7AjA-ZXwf8MT05oIT-lbxIOsTG0n1i_OrQf6ZCePBL5drV-rT9Pxp7TWb_6Pj67Bz9SmF7beB4wTOf2Fr9-aTegQR0nh58uxOss8PN4dY1NXSpkMrbiXMlEvgX03nmesFyDLXgeyVIqX6mANtS26NHGJBO4Dgq5quvHmitXcOTtVYh-1BGe_RBy_dM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