Browse Source

xtask: codegen: use uapi kernel headers from libbpf

libbpf periodically syncs uapi headers from the kernel. Use those to
generate bindings so that we don't have to rely on distro packages
when we cut releases.
Alessandro Decina 4 năm trước cách đây
mục cha
commit
c44393d59b
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  1. 8 0
      xtask/src/codegen/aya.rs

+ 8 - 0
xtask/src/codegen/aya.rs

@@ -14,6 +14,14 @@ fn codegen_internal_btf_bindings(opts: &Options) -> Result<(), anyhow::Error> {
     let dir = PathBuf::from("aya");
     let generated = dir.join("src/generated");
     let mut bindgen = bindgen::user_builder()
+        .clang_arg(format!(
+            "-I{}",
+            opts.libbpf_dir
+                .join("include/uapi")
+                .canonicalize()
+                .unwrap()
+                .to_string_lossy()
+        ))
         .header(
             opts.libbpf_dir
                 .join("src/libbpf_internal.h")