]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_target/src/spec/bpf_base.rs
New upstream version 1.69.0+dfsg1
[rustc.git] / compiler / rustc_target / src / spec / bpf_base.rs
CommitLineData
136023e0 1use crate::abi::Endian;
17df50a5 2use crate::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, TargetOptions};
17df50a5
XL
3
4pub fn opts(endian: Endian) -> TargetOptions {
5 TargetOptions {
6 allow_asm: true,
7 endian,
f2b60f7d 8 linker_flavor: LinkerFlavor::Bpf,
9ffffee4 9 atomic_cas: false,
17df50a5
XL
10 dynamic_linking: true,
11 no_builtins: 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,
19 obj_is_bitcode: true,
20 requires_lto: false,
21 singlethread: true,
9c376795
FG
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),
17df50a5 26 max_atomic_width: Some(64),
17df50a5
XL
27 ..Default::default()
28 }
29}