@@ -15,17 +15,7 @@ pub(crate) fn target() -> Target {
1515 } ,
1616 pointer_width : 32 ,
1717 arch : Arch :: Arm ,
18- /* Data layout args are '-' separated:
19- * little endian
20- * stack is 64-bit aligned (EABI)
21- * pointers are 32-bit
22- * i64 must be 64-bit aligned (EABI)
23- * mangle names with ELF style
24- * native integers are 32-bit
25- * All other elements are default
26- */
2718 data_layout : "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" . into ( ) ,
28-
2919 options : TargetOptions {
3020 abi : Abi :: Eabi ,
3121 llvm_floatabi : Some ( FloatAbi :: Soft ) ,
@@ -35,16 +25,31 @@ pub(crate) fn target() -> Target {
3525 // * use little-endian
3626 asm_args : cvs ! [ "-mthumb-interwork" , "-march=armv5te" , "-mlittle-endian" , ] ,
3727 // minimum extra features, these cannot be disabled via -C
38- // Also force-enable 32-bit atomics, which allows the use of atomic load/store only.
39- // The resulting atomics are ABI incompatible with atomics backed by libatomic.
40- features : "+soft-float,+strict-align,+atomics-32" . into ( ) ,
41- frame_pointer : FramePointer :: MayOmit ,
42- main_needs_argc_argv : false ,
43- // don't have atomic compare-and-swap
28+ features : "+soft-float,+strict-align" . into ( ) ,
4429 atomic_cas : false ,
4530 has_thumb_interworking : true ,
46-
47- ..base:: thumb:: opts ( )
31+ linker_flavor : LinkerFlavor :: Gnu ( Cc :: No , Lld :: Yes ) ,
32+ linker : Some ( "rust-lld" . into ( ) ) ,
33+ // Because these devices have very little resources having an unwinder is too onerous so we
34+ // default to "abort" because the "unwind" strategy is very rare.
35+ panic_strategy : PanicStrategy :: Abort ,
36+ // Similarly, one almost always never wants to use relocatable code because of the extra
37+ // costs it involves.
38+ relocation_model : RelocModel :: Static ,
39+ // When this section is added a volatile load to its start address is also generated. This
40+ // volatile load is a footgun as it can end up loading an invalid memory address, depending
41+ // on how the user set up their linker scripts. This section adds pretty printer for stuff
42+ // like std::Vec, which is not that used in no-std context, so it's best to left it out
43+ // until we figure a way to add the pretty printers without requiring a volatile load cf.
44+ // rust-lang/rust#44993.
45+ emit_debug_gdb_scripts : false ,
46+ // LLVM is eager to trash the link register when calling `noreturn` functions, which
47+ // breaks debugging. Preserve LR by default to prevent that from happening.
48+ frame_pointer : FramePointer :: Always ,
49+ // ARM supports multiple ABIs for enums, the linux one matches the default of 32 here
50+ // but any arm-none or thumb-none target will be defaulted to 8 on GCC.
51+ c_enum_min_bits : Some ( 8 ) ,
52+ ..Default :: default ( )
4853 } ,
4954 }
5055}
0 commit comments