rustc_target/spec/base/
linux.rs

1use std::borrow::Cow;
2
3use crate::spec::{RelroLevel, SplitDebuginfo, TargetOptions, cvs};
4
5pub(crate) fn opts() -> TargetOptions {
6    TargetOptions {
7        os: "linux".into(),
8        dynamic_linking: true,
9        families: cvs!["unix"],
10        has_rpath: true,
11        position_independent_executables: true,
12        relro_level: RelroLevel::Full,
13        has_thread_local: true,
14        crt_static_respected: true,
15        // We want backtraces to work by default and they rely on unwind tables
16        // (regardless of `-C panic` strategy).
17        default_uwtable: true,
18        supported_split_debuginfo: Cow::Borrowed(&[
19            SplitDebuginfo::Packed,
20            SplitDebuginfo::Unpacked,
21            SplitDebuginfo::Off,
22        ]),
23        ..Default::default()
24    }
25}