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

    <tr>
        <th>Summary</th>
        <td>
            [libc] Enforce that libc shared header libraries don't depend on .cpp files
        </td>
    </tr>

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

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

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

<pre>
    Headers in `libc/shared/` are supposed to be included from other LLVM projects (e.g. libc++), and themselves also include internal bits of llvm-libc implementation. By design, all the functionality should be implemented in headers only.

We need to ensure and enforce (by adding build system checks) that libraries exposed in `libc/shared` won't end up including an internal header that would need a corresponding .cpp file to provide certain definitions. Notably, it's **not the case** now, as __support/str_to_integer.h includes `libc_errno.h`, which needs `libc_errno.cpp` to provide internal Errno class methods definitions. @michaelrj-google says we should fix this specific case by breaking this dependency.

Assigning to @lntue who's already working on reworking CMake dependency propagation. I'll look if we can enforce it  in Bazel as well, now that we have filegroup construction through genrules for all internal building blocks.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsVE2P2zYQ_TX0ZRBBptby-qCDN4nRAkmP7XFBkSORWYojcCg76q8vSFu7aVHAgGFTfHof80YxuzEgduLwIqT0IS0opBSHLzu1JEuxu1IgnhTvejJr9xsqg5HBBRBt7V2vhbywVRGNkBfR1qAiAi_zTIwGEkGP4IL2i0EDQ6QJKFmM8O3bn99hjvQDdWIQ8hmrsYI74Ev5nIT8DCoYSBYnRn9FBuWZNjhwIWEMykPvEgMN4P11-pQhwE2zxwlDUslRqOBlBYNZacH0PmPCsASdj5V3aQW2tHhT6G6X0WSd9iGZgl8rUZ9Fff4LIeBdHgZeIhaeGAaKGrOYfgVljAsj9IvzBnjlhBNoi_qNhTxBsipltVFFhwz48-7X_9na1nCjIOQxAQYDy_wwIKOr8OHCnecd-Va0FI4KNMWIPFMoVyo9zzA4j5n9HOnqDILGmJQLYHBwwWVTuII_KKner9kyl4Q85pjOQp4DpeKfVoz3fyDQrTjL8Ppawo8pC0jxNdFrZjhirOyWHG8iXzHGQJUVbZ2v36zTtrD-7xN6nrMPvzB-l_01PwDaK2aYMFky_G8Z4qmenLYKffzxaSQaPQKrleGGW-iD-wnJOgaeUbvB6aIN-hX6iOot21aODc4YDAa9DcK51KecU35R6Q_cLBW7lI-ozAo3igWDAkTcfnz-rt7wF8SsbFbjY2B_F_LoPXiiN3BDpqpVeJ8wlyCPyov6G302_YbeZwMD3R75I1h1xZLzGGmZQVPgFJcy8JBspGW0MGKIi0eGgWKpxUel8tiW-fWk37jama4xp-akdtjtj09NXT83bbuzXXPaP8vh2Si1V0YO7WnoGz2cdH_EfX06yp3rZC0PdSPbfXs4ybZSUh_kQdX1UWtdGxRPNU7K-SrXt6I47hzzgt2-afay3XnVo-dtP5VmlPUUu1L3fhk5G-848QdCcsmXnVYuHL7A14dzW-803Nu1teajiubRtXsyObP3xvBuib6zKc0smnPed_IyumSXvtI0CXnJ7398fXrsNiEvRQ4LeXkounbynwAAAP__BKTisA">