feat: support headers provided by the CC toolchain in translate_c#557
Conversation
aherrmann
left a comment
There was a problem hiding this comment.
Thank you!
Same question as last time, see #517 (comment):
We're setting -lc above, AFAIK that means that the Zig compiler will include it's builtin libc headers. If we now also including the Bazel C toolchain's libc headers, doesn't this cause a mishmash of potentially different libcs?
|
It's a tricky one. The answer is that further -isystem will take priority over what is set by zig when using -lc if the CC toolchain provides similar headers. But a cc toolchain doesn't not necessarily provide libc headers. And I would argue that if there is one from a cc toolchain, we should use it since it means we are using it in our c/cxx files anyway. WDYT ? |
Co-authored-by: Andreas Herrmann <[email protected]>
aherrmann
left a comment
There was a problem hiding this comment.
Fair enough, and it is scoped to the translate-c step. Makes sense.
Sometimes, cc toolchains provide additional include directories that are valid to be included implicitly.