|
| 1 | +[build] |
| 2 | +# No global rustflags here; target-specific below. |
| 3 | +# If you always target a specific platform for the server, set: |
| 4 | +# target = "x86_64-unknown-linux-gnu" |
| 5 | + |
| 6 | +# -------- Server target (GNU Linux example) -------- |
| 7 | +[target.x86_64-unknown-linux-gnu] |
| 8 | +rustflags = [ |
| 9 | + "-C", "target-cpu=native", # use host CPU features for the server |
| 10 | + "-C", "symbol-mangling-version=v0", |
| 11 | + "-C", "link-arg=-Wl,--gc-sections", |
| 12 | +] |
| 13 | + |
| 14 | +# macOS (if you build/run locally) |
| 15 | +[target.aarch64-apple-darwin] |
| 16 | +rustflags = [ |
| 17 | + "-C", "target-cpu=native", |
| 18 | + "-C", "symbol-mangling-version=v0", |
| 19 | + "-C", "link-arg=-Wl,-dead_strip", |
| 20 | +] |
| 21 | + |
| 22 | +# -------- eBPF target (Aya / bpfel-unknown-none as an example) -------- |
| 23 | +# Adjust this triple to your actual BPF target (bpfel-unknown-none or bpfeb) |
| 24 | +[target.bpfel-unknown-none] |
| 25 | +rustflags = [ |
| 26 | + # keep minimal & portable; let profiles set panic=abort |
| 27 | + "-C", "link-arg=-z", # placeholder; typically no special link args here |
| 28 | + # (avoid target-cpu=native, avoid exotic link flags) |
| 29 | +] |
| 30 | + |
| 31 | +# -------- Optional MUSL for small static server builds -------- |
| 32 | +# [target.x86_64-unknown-linux-musl] |
| 33 | +# linker = "musl-gcc" |
| 34 | +# rustflags = [ |
| 35 | +# "-C", "target-cpu=x86-64-v3", |
| 36 | +# "-C", "embed-bitcode=no", |
| 37 | +# "-C", "symbol-mangling-version=v0", |
| 38 | +# "-C", "link-arg=-Wl,--gc-sections", |
| 39 | +# ] |
0 commit comments