diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 33fa8ee18..7427ba1b2 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -234,3 +234,6 @@ split-debuginfo = "packed" [profile.release.package.firezone-gui-client] debug = "full" split-debuginfo = "packed" + +[profile.release.package.ebpf-turn-router] +debug = 2 diff --git a/rust/relay/ebpf-turn-router/build.rs b/rust/relay/ebpf-turn-router/build.rs index 3655e0aba..b25dbd27e 100644 --- a/rust/relay/ebpf-turn-router/build.rs +++ b/rust/relay/ebpf-turn-router/build.rs @@ -14,4 +14,11 @@ use which::which; fn main() { let bpf_linker = which("bpf-linker").expect("bpf-linker not found in $PATH"); println!("cargo:rerun-if-changed={}", bpf_linker.to_str().unwrap()); + + if std::env::var("CARGO_BUILD_TARGET") + .ok() + .is_some_and(|t| t == "bpfel-unknown-none" || t == "bpfeb-unknown-unknown") + { + println!("cargo:rustc-link-arg=--btf"); + } }