rustc_target/spec/targets/
thumbv7a_pc_windows_msvc.rs

1use crate::spec::{FloatAbi, LinkerFlavor, Lld, PanicStrategy, Target, TargetOptions, base};
2
3pub(crate) fn target() -> Target {
4    let mut base = base::windows_msvc::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    base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/OPT:NOLBR"]);
13
14    Target {
15        llvm_target: "thumbv7a-pc-windows-msvc".into(),
16        metadata: crate::spec::TargetMetadata {
17            description: None,
18            tier: Some(3),
19            host_tools: Some(false),
20            std: None, // ?
21        },
22        pointer_width: 32,
23        data_layout: "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
24        arch: "arm".into(),
25        options: TargetOptions {
26            llvm_floatabi: Some(FloatAbi::Hard),
27            features: "+vfp3,+neon".into(),
28            max_atomic_width: Some(64),
29            // FIXME(jordanrh): use PanicStrategy::Unwind when SEH is
30            // implemented for windows/arm in LLVM
31            panic_strategy: PanicStrategy::Abort,
32            ..base
33        },
34    }
35}