]> git.lizzy.rs Git - rust.git/blob - src/librustc_target/spec/thumbv7a_pc_windows_msvc.rs
Rollup merge of #68440 - matthiaskrgr:xpyclippy, r=Mark-Simulacrum
[rust.git] / src / librustc_target / spec / thumbv7a_pc_windows_msvc.rs
1 use crate::spec::{LinkerFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
2
3 pub fn target() -> TargetResult {
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     base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap().push("/OPT:NOLBR".to_string());
14
15     // FIXME(jordanrh): use PanicStrategy::Unwind when SEH is
16     // implemented for windows/arm in LLVM
17     base.panic_strategy = PanicStrategy::Abort;
18
19     Ok(Target {
20         llvm_target: "thumbv7a-pc-windows-msvc".to_string(),
21         target_endian: "little".to_string(),
22         target_pointer_width: "32".to_string(),
23         target_c_int_width: "32".to_string(),
24         data_layout: "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
25         arch: "arm".to_string(),
26         target_os: "windows".to_string(),
27         target_env: "msvc".to_string(),
28         target_vendor: "pc".to_string(),
29         linker_flavor: LinkerFlavor::Msvc,
30
31         options: TargetOptions {
32             features: "+vfp3,+neon".to_string(),
33             cpu: "generic".to_string(),
34             max_atomic_width: Some(64),
35             abi_blacklist: super::arm_base::abi_blacklist(),
36             ..base
37         },
38     })
39 }