Skip to content

Commit 95650e8

Browse files
committed
fix bpf flags
Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
1 parent 42862d8 commit 95650e8

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
cargo install bpf-linker --git https://github.com/aya-rs/bpf-linker.git
7575
cargo +nightly build --verbose --target ${{ matrix.target }} --features stealth
7676
cargo +nightly build \
77-
--release \
77+
--profile bpf \
7878
-p fault-ebpf-programs \
7979
--target=bpfel-unknown-none \
8080
-Z build-std=core

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ jobs:
322322
cargo install bpf-linker --git https://github.com/aya-rs/bpf-linker.git
323323
cargo +nightly build --profile prod-fast --features stealth --target ${{ matrix.target }}
324324
cargo +nightly build \
325-
--release \
325+
--profile bpf \
326326
-p fault-ebpf-programs \
327327
--target=bpfel-unknown-none \
328328
-Z build-std=core
@@ -334,7 +334,7 @@ jobs:
334334
cargo install bpf-linker --git https://github.com/aya-rs/bpf-linker.git
335335
cargo +nightly zigbuild --profile prod-fast --features stealth --target ${{ matrix.target }}
336336
cargo +nightly build \
337-
--release \
337+
--profile bpf \
338338
-p fault-ebpf-programs \
339339
--target=bpfel-unknown-none \
340340
-Z build-std=core

Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,13 @@ codegen-units = 1
6363
# (leave out panic/lto/strip)
6464

6565
# eBPF crate: conservative tweaks; again, no panic/lto/strip here
66-
[profile.release.package.fault-ebpf-programs]
67-
opt-level = "z"
66+
[profile.bpf]
67+
inherits = "release"
68+
lto = "off" # <<< IMPORTANT: no LTO for BPF
69+
opt-level = "z" # small is good for eBPF objects
6870
codegen-units = 1
71+
panic = "abort"
6972
debug = 0
7073
debug-assertions = false
7174
overflow-checks = false
72-
# (leave out panic/lto/strip)
75+
strip = "debuginfo"

0 commit comments

Comments
 (0)