diff --git a/aya-gen/src/bindgen.rs b/aya-gen/src/bindgen.rs index 137c25e0..b927d761 100644 --- a/aya-gen/src/bindgen.rs +++ b/aya-gen/src/bindgen.rs @@ -13,7 +13,7 @@ pub fn user_builder() -> Builder { pub fn bpf_builder() -> Builder { bindgen::builder() .use_core() - .ctypes_prefix("::aya_bpf_cty") + .ctypes_prefix("::aya_bpf::cty") .layout_tests(false) .generate_comments(false) .clang_arg("-Wno-unknown-attributes") diff --git a/xtask/src/codegen/aya_bpf_bindings.rs b/xtask/src/codegen/aya_bpf_bindings.rs index dc41d9c6..20cd2262 100644 --- a/xtask/src/codegen/aya_bpf_bindings.rs +++ b/xtask/src/codegen/aya_bpf_bindings.rs @@ -21,6 +21,9 @@ pub fn codegen(opts: &Options) -> Result<(), anyhow::Error> { let builder = || { let mut bindgen = bindgen::bpf_builder() .header(&*dir.join("include/bindings.h").to_string_lossy()) + // aya-gen uses aya_bpf::cty. We can't use that here since aya-bpf + // depends on aya-bpf-bindings so it would create a circular dep. + .ctypes_prefix("::aya_bpf_cty") .clang_args(&[ "-I", &*opts.libbpf_dir.join("include/uapi").to_string_lossy(),