From 08ea655b104ab519ba27d27e1aef03607f18335a Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Thu, 27 Mar 2025 10:59:16 +1100 Subject: [PATCH] aya-ebpf: only compile panic-handler for bpf target --- ebpf/aya-ebpf/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebpf/aya-ebpf/src/lib.rs b/ebpf/aya-ebpf/src/lib.rs index f6d3a766..ae1f6132 100644 --- a/ebpf/aya-ebpf/src/lib.rs +++ b/ebpf/aya-ebpf/src/lib.rs @@ -143,7 +143,7 @@ macro_rules! panic_handler { /// Yet, as part of compiling for `no_std`, we need to define a panic handler. /// The eBPF verifier enforces that programs terminate and will thus reject unbounded loops. /// By using an endless loop within our panic handler, we can ensure that if this panic handler were somehow linked into the program, the eBPF verifier would reject it. - #[cfg(not(test))] + #[cfg(target_arch = "bpf")] #[panic_handler] fn panic(_info: &core::panic::PanicInfo) -> ! { loop {}