]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_target/src/spec/armv4t_none_eabi.rs
New upstream version 1.74.1+dfsg1
[rustc.git] / compiler / rustc_target / src / spec / armv4t_none_eabi.rs
CommitLineData
f2b60f7d
FG
1//! Targets the ARMv4T, with code as `a32` code by default.
2//!
3//! Primarily of use for the GBA, but usable with other devices too.
4//!
5//! Please ping @Lokathor if changes are needed.
6//!
f2b60f7d
FG
7//! **Important:** This target profile **does not** specify a linker script. You
8//! just get the default link script when you build a binary for this target.
9//! The default link script is very likely wrong, so you should use
10//! `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script.
11
2b03887a 12use crate::spec::{cvs, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
f2b60f7d
FG
13
14pub fn target() -> Target {
15 Target {
16 llvm_target: "armv4t-none-eabi".into(),
17 pointer_width: 32,
18 arch: "arm".into(),
19 /* Data layout args are '-' separated:
20 * little endian
21 * stack is 64-bit aligned (EABI)
22 * pointers are 32-bit
23 * i64 must be 64-bit aligned (EABI)
24 * mangle names with ELF style
25 * native integers are 32-bit
26 * All other elements are default
27 */
28 data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
29 options: TargetOptions {
30 abi: "eabi".into(),
353b0b11
FG
31 linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
32 linker: Some("rust-lld".into()),
f2b60f7d
FG
33 asm_args: cvs!["-mthumb-interwork", "-march=armv4t", "-mlittle-endian",],
34 // Force-enable 32-bit atomics, which allows the use of atomic load/store only.
35 // The resulting atomics are ABI incompatible with atomics backed by libatomic.
36 features: "+soft-float,+strict-align,+atomics-32".into(),
37 main_needs_argc_argv: false,
38 atomic_cas: false,
39 has_thumb_interworking: true,
40 relocation_model: RelocModel::Static,
41 panic_strategy: PanicStrategy::Abort,
add651ee 42 // From thumb_base, rust-lang/rust#44993.
f2b60f7d 43 emit_debug_gdb_scripts: false,
add651ee 44 // From thumb_base, GCC gives enums a minimum of 8 bits on no-os targets.
9ffffee4 45 c_enum_min_bits: Some(8),
f2b60f7d
FG
46 ..Default::default()
47 },
48 }
49}