1 use crate::abi::Endian;
2 use crate::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, TargetOptions};
4 pub fn opts(endian: Endian) -> TargetOptions {
8 linker_flavor: LinkerFlavor::Bpf,
10 dynamic_linking: true,
12 panic_strategy: PanicStrategy::Abort,
13 position_independent_executables: true,
14 // Disable MergeFunctions since:
15 // - older kernels don't support bpf-to-bpf calls
16 // - on newer kernels, userspace still needs to relocate before calling
17 // BPF_PROG_LOAD and not all BPF libraries do that yet
18 merge_functions: MergeFunctions::Disabled,
22 // When targeting the `v3` cpu in llvm, 32-bit atomics are also supported.
23 // But making this value change based on the target cpu can be mostly confusing
24 // and would require a bit of a refactor.
25 min_atomic_width: Some(64),
26 max_atomic_width: Some(64),