Fix aya-ebpf-* riscv64 build (#1139)

bpf_target_arch should be riscv64, but target triple starts with riscv64gc (and possibly riscv64 followed by any combination of extensions).
reviewable/pr1145/r1
Eric Long 1 week ago committed by GitHub
parent 29b821376e
commit 1fe12b9990
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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\"))");

@ -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\"))");

@ -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\"))");

Loading…
Cancel
Save