diff --git a/ebpf/aya-ebpf-bindings/build.rs b/ebpf/aya-ebpf-bindings/build.rs index e491077d8..f61e01460 100644 --- a/ebpf/aya-ebpf-bindings/build.rs +++ b/ebpf/aya-ebpf-bindings/build.rs @@ -6,7 +6,10 @@ fn main() { println!("cargo:rustc-cfg=bpf_target_arch=\"{arch}\""); } else { let arch = env::var("HOST").unwrap(); - let arch = arch.split_once('-').map_or(&*arch, |x| x.0); + let mut arch = arch.split_once('-').map_or(&*arch, |x| x.0); + if arch.starts_with("riscv64") { + arch = "riscv64"; + } println!("cargo:rustc-cfg=bpf_target_arch=\"{arch}\""); } println!("cargo::rustc-check-cfg=cfg(bpf_target_arch, values(\"x86_64\",\"arm\",\"aarch64\",\"riscv64\",\"powerpc64\",\"s390x\"))"); diff --git a/ebpf/aya-ebpf-cty/build.rs b/ebpf/aya-ebpf-cty/build.rs index 8642bdbec..9567a0dc9 100644 --- a/ebpf/aya-ebpf-cty/build.rs +++ b/ebpf/aya-ebpf-cty/build.rs @@ -6,7 +6,10 @@ fn main() { println!("cargo:rustc-cfg=bpf_target_arch=\"{arch}\""); } else { let arch = env::var("HOST").unwrap(); - let arch = arch.split_once('-').map_or(&*arch, |x| x.0); + let mut arch = arch.split_once('-').map_or(&*arch, |x| x.0); + if arch.starts_with("riscv64") { + arch = "riscv64"; + } println!("cargo:rustc-cfg=bpf_target_arch=\"{arch}\""); } println!("cargo::rustc-check-cfg=cfg(bpf_target_arch, values(\"x86_64\",\"arm\",\"aarch64\",\"riscv64\",\"powerpc64\",\"s390x\"))"); diff --git a/ebpf/aya-ebpf/build.rs b/ebpf/aya-ebpf/build.rs index 38887c3bc..fbbdc19f3 100644 --- a/ebpf/aya-ebpf/build.rs +++ b/ebpf/aya-ebpf/build.rs @@ -7,7 +7,10 @@ fn main() { println!("cargo:rustc-cfg=bpf_target_arch=\"{arch}\""); } else { let arch = env::var("HOST").unwrap(); - let arch = arch.split_once('-').map_or(&*arch, |x| x.0); + let mut arch = arch.split_once('-').map_or(&*arch, |x| x.0); + if arch.starts_with("riscv64") { + arch = "riscv64"; + } println!("cargo:rustc-cfg=bpf_target_arch=\"{arch}\""); } println!("cargo::rustc-check-cfg=cfg(bpf_target_arch, values(\"x86_64\",\"arm\",\"aarch64\",\"riscv64\",\"powerpc64\",\"s390x\"))");