1 use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
3 pub fn target() -> TargetResult {
4 let mut base = super::windows_msvc_base::opts();
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());
16 .get_mut(&LinkerFlavor::Lld(LldFlavor::Link))
18 .push(pre_link_args_msvc);
20 // FIXME(jordanrh): use PanicStrategy::Unwind when SEH is
21 // implemented for windows/arm in LLVM
22 base.panic_strategy = PanicStrategy::Abort;
25 llvm_target: "thumbv7a-pc-windows-msvc".to_string(),
26 target_endian: "little".to_string(),
27 target_pointer_width: "32".to_string(),
28 target_c_int_width: "32".to_string(),
29 data_layout: "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
30 arch: "arm".to_string(),
31 target_os: "windows".to_string(),
32 target_env: "msvc".to_string(),
33 target_vendor: "pc".to_string(),
34 linker_flavor: LinkerFlavor::Msvc,
36 options: TargetOptions {
37 features: "+vfp3,+neon".to_string(),
38 cpu: "generic".to_string(),
39 max_atomic_width: Some(64),
40 abi_blacklist: super::arm_base::abi_blacklist(),