]> git.lizzy.rs Git - rust.git/blob - src/librustc_target/spec/powerpc64_unknown_linux_gnu.rs
Auto merge of #68414 - michaelwoerister:share-drop-glue, r=alexcrichton
[rust.git] / src / librustc_target / spec / powerpc64_unknown_linux_gnu.rs
1 use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions, TargetResult};
2
3 pub fn target() -> TargetResult {
4     let mut base = super::linux_base::opts();
5     base.cpu = "ppc64".to_string();
6     base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
7     base.max_atomic_width = Some(64);
8
9     // ld.so in at least RHEL6 on ppc64 has a bug related to BIND_NOW, so only enable partial RELRO
10     // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
11     base.relro_level = RelroLevel::Partial;
12
13     Ok(Target {
14         llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
15         target_endian: "big".to_string(),
16         target_pointer_width: "64".to_string(),
17         target_c_int_width: "32".to_string(),
18         data_layout: "E-m:e-i64:64-n32:64".to_string(),
19         arch: "powerpc64".to_string(),
20         target_os: "linux".to_string(),
21         target_env: "gnu".to_string(),
22         target_vendor: "unknown".to_string(),
23         linker_flavor: LinkerFlavor::Gcc,
24         options: TargetOptions { target_mcount: "_mcount".to_string(), ..base },
25     })
26 }