[libc-commits] [libc] [libc] Suppress GCC's <mm_malloc.h> in freestanding builds (PR #234863)
Pavel Labath via libc-commits
libc-commits at lists.llvm.org
Fri Oct 23 00:12:42 PDT 2026
labath wrote:
This is a simple, though slightly hacky way to prevent this problem (which happens even without https://github.com/llvm/llvm-project/pull/234150, though with a lower frequency).
Another way to handle it would be to create proxy headers wrapping the compiler intrinsic headers. Then, we could either apply the same tricky inside the proxies, or we could make the proxies depend on our stdlib.h.
It wasn't my first choice, as it would mean wrapping every intrinsic header which can transitively include mm_malloc.h, and we would still run the risk of someone including the header directly.
Note that removing gcc's stdlib.h from the include search path (if it is even possible) does not help as that would just cause the build to fail due to an unresolved include.
The test/compile rule duplication is unfortunate, but it sounds like you may be doing something about that right now..
https://github.com/llvm/llvm-project/pull/234863
More information about the libc-commits
mailing list