1 | use crate::spec::{ |
---|---|
2 | FloatAbi, LinkerFlavor, Lld, PanicStrategy, Target, TargetMetadata, TargetOptions, base, |
3 | }; |
4 | |
5 | pub(crate) fn target() -> Target { |
6 | let mut base = base::windows_msvc::opts(); |
7 | // Prevent error LNK2013: BRANCH24(T) fixup overflow |
8 | // The LBR optimization tries to eliminate branch islands, |
9 | // but if the displacement is larger than can fit |
10 | // in the instruction, this error will occur. The linker |
11 | // should be smart enough to insert branch islands only |
12 | // where necessary, but this is not the observed behavior. |
13 | // Disabling the LBR optimization works around the issue. |
14 | base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/OPT:NOLBR"]); |
15 | |
16 | Target { |
17 | llvm_target: "thumbv7a-pc-windows-msvc".into(), |
18 | metadata: TargetMetadata { |
19 | description: None, |
20 | tier: Some(3), |
21 | host_tools: Some(false), |
22 | std: None, // ? |
23 | }, |
24 | pointer_width: 32, |
25 | data_layout: "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(), |
26 | arch: "arm".into(), |
27 | options: TargetOptions { |
28 | llvm_floatabi: Some(FloatAbi::Hard), |
29 | features: "+vfp3,+neon".into(), |
30 | max_atomic_width: Some(64), |
31 | // FIXME(jordanrh): use PanicStrategy::Unwind when SEH is |
32 | // implemented for windows/arm in LLVM |
33 | panic_strategy: PanicStrategy::Abort, |
34 | ..base |
35 | }, |
36 | } |
37 | } |
38 |
Definitions
Learn Rust with the experts
Find out more