rustc_target/spec/targets/
thumbv7neon_unknown_linux_gnueabihf.rs

1use crate::spec::{FloatAbi, Target, TargetOptions, base};
2
3// This target is for glibc 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-gnueabihf".into(),
12        metadata: crate::spec::TargetMetadata {
13            description: Some(
14                "Thumb2-mode ARMv7-A Linux with NEON (kernel 4.4, glibc 2.23)".into(),
15            ),
16            tier: Some(2),
17            host_tools: Some(false),
18            std: Some(true),
19        },
20        pointer_width: 32,
21        data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
22        arch: "arm".into(),
23        options: TargetOptions {
24            abi: "eabihf".into(),
25            llvm_floatabi: Some(FloatAbi::Hard),
26            // Info about features at https://wiki.debian.org/ArmHardFloatPort
27            features: "+v7,+thumb-mode,+thumb2,+vfp3,+neon".into(),
28            max_atomic_width: Some(64),
29            ..base::linux_gnu::opts()
30        },
31    }
32}