rustc_target/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs
1use crate::spec::{FloatAbi, Target, TargetMetadata, TargetOptions, base};
2
3// This target is for musl Linux on ARMv7 with thumb mode enabled
4// (for consistency with Android and Debian-based distributions)
5// and with NEON unconditionally enabled and, therefore, with 32 FPU
6// registers enabled as well. See section A2.6.2 on page A2-56 in
7// https://web.archive.org/web/20210307234416/https://static.docs.arm.com/ddi0406/cd/DDI0406C_d_armv7ar_arm.pdf
8
9pub(crate) fn target() -> Target {
10 Target {
11 llvm_target: "armv7-unknown-linux-musleabihf".into(),
12 metadata: TargetMetadata {
13 description: Some("Thumb2-mode ARMv7-A Linux with NEON, musl 1.2.3".into()),
14 tier: Some(3),
15 host_tools: Some(false),
16 std: Some(true),
17 },
18 pointer_width: 32,
19 data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
20 arch: "arm".into(),
21
22 // Most of these settings are copied from the thumbv7neon_unknown_linux_gnueabihf
23 // target.
24 options: TargetOptions {
25 abi: "eabihf".into(),
26 llvm_floatabi: Some(FloatAbi::Hard),
27 features: "+v7,+thumb-mode,+thumb2,+vfp3,+neon".into(),
28 max_atomic_width: Some(64),
29 mcount: "\u{1}mcount".into(),
30 // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
31 crt_static_default: true,
32 ..base::linux_musl::opts()
33 },
34 }
35}