Merge pull request #1154 from dave-tucker/fix-codegen

chore(codegen): Fix duplicate BPF_F_LINK
pull/1096/merge
Dave Tucker 3 weeks ago committed by GitHub
commit fdd25cd434
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -216,6 +216,10 @@ fn codegen_bindings(opts: &SysrootOptions, libbpf_dir: &Path) -> Result<(), anyh
for x in &vars { for x in &vars {
bindgen = bindgen bindgen = bindgen
.allowlist_var(x) .allowlist_var(x)
// BPF_F_LINK is defined twice. Once in an anonymous enum
// which bindgen will constify, and once via #define macro
// which generates a duplicate const.
.blocklist_var("BPF_F_LINK")
.constified_enum("BPF_F_.*") .constified_enum("BPF_F_.*")
.constified_enum("BTF_KIND_.*") .constified_enum("BTF_KIND_.*")
.constified_enum("BTF_VAR_.*") .constified_enum("BTF_VAR_.*")

@ -36,6 +36,10 @@ pub fn codegen(opts: &SysrootOptions, libbpf_dir: &Path) -> Result<(), anyhow::E
.clang_args(&["-I", &*libbpf_dir.join("include/uapi").to_string_lossy()]) .clang_args(&["-I", &*libbpf_dir.join("include/uapi").to_string_lossy()])
.clang_args(&["-I", &*libbpf_dir.join("include").to_string_lossy()]) .clang_args(&["-I", &*libbpf_dir.join("include").to_string_lossy()])
.clang_args(&["-I", &*libbpf_dir.join("src").to_string_lossy()]) .clang_args(&["-I", &*libbpf_dir.join("src").to_string_lossy()])
// BPF_F_LINK is defined twice. Once in an anonymous enum
// which bindgen will constify, and once via #define macro
// which generates a duplicate const.
.blocklist_var("BPF_F_LINK")
// open aya-ebpf-bindings/.../bindings.rs and look for mod // open aya-ebpf-bindings/.../bindings.rs and look for mod
// _bindgen, those are anonymous enums // _bindgen, those are anonymous enums
.constified_enum("BPF_F_.*") .constified_enum("BPF_F_.*")

Loading…
Cancel
Save