]> git.proxmox.com Git - rustc.git/blame - vendor/rustc-ap-rustc_target/src/spec/thumbv7a_pc_windows_msvc.rs
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / vendor / rustc-ap-rustc_target / src / spec / thumbv7a_pc_windows_msvc.rs
CommitLineData
f20569fa
XL
1use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions};
2
3pub fn target() -> Target {
4 let mut base = super::windows_msvc_base::opts();
5
6 // Prevent error LNK2013: BRANCH24(T) fixup overflow
7 // The LBR optimization tries to eliminate branch islands,
8 // but if the displacement is larger than can fit
9 // in the instruction, this error will occur. The linker
10 // should be smart enough to insert branch islands only
11 // where necessary, but this is not the observed behavior.
12 // Disabling the LBR optimization works around the issue.
13 let pre_link_args_msvc = "/OPT:NOLBR".to_string();
14 base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap().push(pre_link_args_msvc.clone());
15 base.pre_link_args
16 .get_mut(&LinkerFlavor::Lld(LldFlavor::Link))
17 .unwrap()
18 .push(pre_link_args_msvc);
19
20 // FIXME(jordanrh): use PanicStrategy::Unwind when SEH is
21 // implemented for windows/arm in LLVM
22 base.panic_strategy = PanicStrategy::Abort;
23
24 Target {
25 llvm_target: "thumbv7a-pc-windows-msvc".to_string(),
26 pointer_width: 32,
27 data_layout: "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
28 arch: "arm".to_string(),
29
30 options: TargetOptions {
31 features: "+vfp3,+neon".to_string(),
32 cpu: "generic".to_string(),
33 max_atomic_width: Some(64),
34 unsupported_abis: super::arm_base::unsupported_abis(),
35 ..base
36 },
37 }
38}