1 use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions};
2 
target() -> Target3 pub fn target() -> Target {
4     let mut base = super::windows_msvc_base::opts();
5     // Prevent error LNK2013: BRANCH24(T) fixup overflow
6     // The LBR optimization tries to eliminate branch islands,
7     // but if the displacement is larger than can fit
8     // in the instruction, this error will occur. The linker
9     // should be smart enough to insert branch islands only
10     // where necessary, but this is not the observed behavior.
11     // Disabling the LBR optimization works around the issue.
12     let pre_link_args_msvc = "/OPT:NOLBR".to_string();
13     base.pre_link_args.entry(LinkerFlavor::Msvc).or_default().push(pre_link_args_msvc.clone());
14     base.pre_link_args
15         .entry(LinkerFlavor::Lld(LldFlavor::Link))
16         .or_default()
17         .push(pre_link_args_msvc);
18 
19     Target {
20         llvm_target: "thumbv7a-pc-windows-msvc".to_string(),
21         pointer_width: 32,
22         data_layout: "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
23         arch: "arm".to_string(),
24         options: TargetOptions {
25             features: "+vfp3,+neon".to_string(),
26             max_atomic_width: Some(64),
27             // FIXME(jordanrh): use PanicStrategy::Unwind when SEH is
28             // implemented for windows/arm in LLVM
29             panic_strategy: PanicStrategy::Abort,
30             ..base
31         },
32     }
33 }
34