]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/bpf_base.rs
Rollup merge of #91518 - luojia65:rustdoc-riscv-arch, r=GuillaumeGomez
[rust.git] / compiler / rustc_target / src / spec / bpf_base.rs
1 use crate::abi::Endian;
2 use crate::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, TargetOptions};
3
4 pub fn opts(endian: Endian) -> TargetOptions {
5     TargetOptions {
6         allow_asm: true,
7         endian,
8         linker_flavor: LinkerFlavor::BpfLinker,
9         atomic_cas: false,
10         executables: true,
11         dynamic_linking: true,
12         no_builtins: true,
13         panic_strategy: PanicStrategy::Abort,
14         position_independent_executables: true,
15         // Disable MergeFunctions since:
16         // - older kernels don't support bpf-to-bpf calls
17         // - on newer kernels, userspace still needs to relocate before calling
18         //   BPF_PROG_LOAD and not all BPF libraries do that yet
19         merge_functions: MergeFunctions::Disabled,
20         obj_is_bitcode: true,
21         requires_lto: false,
22         singlethread: true,
23         max_atomic_width: Some(64),
24         ..Default::default()
25     }
26 }