Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(codegen): Fix duplicate BPF_F_LINK #1154

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions xtask/src/codegen/aya.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ fn codegen_bindings(opts: &SysrootOptions, libbpf_dir: &Path) -> Result<(), anyh
for x in &vars {
bindgen = bindgen
.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("BTF_KIND_.*")
.constified_enum("BTF_VAR_.*")
Expand Down
4 changes: 4 additions & 0 deletions xtask/src/codegen/aya_ebpf_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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").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
// _bindgen, those are anonymous enums
.constified_enum("BPF_F_.*")
Expand Down
Loading