[libc-commits] [libc] [llvm] [libc] Move generated elf header to include (PR #211428)

Alexey Samsonov via libc-commits libc-commits at lists.llvm.org
Fri Jul 24 08:36:41 PDT 2026


================
@@ -1,667 +1,5 @@
 header: elf.h
+public_includes:
----------------
vonosmas wrote:

1. I'm OK with, and support renaming the directory, so that it gets put under `<llvm-libc-proxies/elf-proxy.h>` similar to our llvm-libc-specific directories for types and macro. (@michaelrj-google  - I think it's a superior solution to using .h.def and `""`-style includes - as @labath points out, even with `""` includes we'll end up with installed `proxy/` directory.
2. The problem with `<elf.h>` is two-fold - first, it's the macro definitions that need to be accessible. You are right that a potential workaround is to simply move those macro definitions that we want to re-use to `elf-macros.h`, for consistency and for now (even though @frobtech would prefer to make as much as possible macros defined in YAML, at some point, eventually). The second problem is a ton of types (`Elf64_Addr` and friends). Normally, in llvm-libc we follow IWYU and have one proxy-header in `hdr/` per type, which dispatches either to type definition in `llvm-libc-types/` or to system header. But there are just too many of those for this pattern to be convenient. I might also be missing other motivation that was present when @petrhosek added the existing structure in https://github.com/llvm/llvm-project/pull/172766.

https://github.com/llvm/llvm-project/pull/211428


More information about the libc-commits mailing list