[llvm] [libc][bazel] Add generation for public headers (PR #184889)

Michael Jones via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 6 09:07:28 PST 2026


================
@@ -100,6 +102,534 @@ libc_generated_header(
     yaml_template = "include/stdbit.yaml",
 )
 
+libc_generated_header(
+    name = "include_stdio_h",
+    hdr = "staging/include/stdio.h",
+    other_srcs = ["include/stdio.h.def"],
+    yaml_template = "include/stdio.yaml",
+)
+
+libc_generated_header(
+    name = "include_string_h",
+    hdr = "staging/include/string.h",
+    yaml_template = "include/string.yaml",
+)
+
+libc_generated_header(
+    name = "include_stdlib_h",
+    hdr = "staging/include/stdlib.h",
+    other_srcs = [
+        "include/stdlib.h.def",
+        "include/stdlib-malloc.yaml",
+    ],
+    yaml_template = "include/stdlib.yaml",
+)
+
+libc_generated_header(
+    name = "include_malloc_h",
+    hdr = "staging/include/malloc.h",
+    other_srcs = ["include/stdlib-malloc.yaml"],
+    yaml_template = "include/malloc.yaml",
+)
+
+libc_generated_header(
+    name = "include_signal_h",
+    hdr = "staging/include/signal.h",
+    other_srcs = ["include/signal.h.def"],
+    yaml_template = "include/signal.yaml",
+)
+
+libc_generated_header(
+    name = "include_stdint_h",
+    hdr = "staging/include/stdint.h",
+    other_srcs = ["include/stdint.h.def"],
+    yaml_template = "include/stdint.yaml",
+)
+
+libc_generated_header(
+    name = "include_limits_h",
+    hdr = "staging/include/limits.h",
+    other_srcs = ["include/limits.h.def"],
+    yaml_template = "include/limits.yaml",
+)
+
+libc_generated_header(
+    name = "include_float_h",
+    hdr = "staging/include/float.h",
+    other_srcs = ["include/float.h.def"],
+    yaml_template = "include/float.yaml",
+)
+
+libc_generated_header(
+    name = "include_ctype_h",
+    hdr = "staging/include/ctype.h",
+    other_srcs = [],
+    yaml_template = "include/ctype.yaml",
+)
+
+libc_generated_header(
+    name = "include_fenv_h",
+    hdr = "staging/include/fenv.h",
+    other_srcs = [],
+    yaml_template = "include/fenv.yaml",
+)
+
+libc_generated_header(
+    name = "include_inttypes_h",
+    hdr = "staging/include/inttypes.h",
+    other_srcs = ["include/inttypes.h.def"],
+    yaml_template = "include/inttypes.yaml",
+)
+
+genrule(
+    name = "hdr_elf_proxy_h",
+    srcs = ["include/elf.yaml"],
+    outs = ["hdr/elf_proxy.h"],
+    cmd = "$(location //libc:hdrgen) $(location include/elf.yaml) -o $@ --proxy",
+    tools = ["//libc:hdrgen"],
+)
----------------
michaelrj-google wrote:

TODO: add extra option to libc_generated_header instead of writing a genrule here

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


More information about the llvm-commits mailing list