Apply c_enum_min_bits = 8 to (arm|thumb)-none- platforms

This commit is contained in:
Manish Goregaokar 2021-08-10 12:06:59 -07:00
parent fd116c806a
commit 4c0e424461
7 changed files with 14 additions and 0 deletions

View file

@ -20,6 +20,8 @@ pub fn target() -> Target {
panic_strategy: PanicStrategy::Abort,
max_atomic_width: Some(32),
emit_debug_gdb_scripts: false,
// GCC and Clang default to 8 for arm-none here
c_enum_min_bits: 8,
..Default::default()
},
}

View file

@ -21,6 +21,8 @@ pub fn target() -> Target {
features: "+vfp3,-d32,-fp16".to_string(),
max_atomic_width: Some(32),
emit_debug_gdb_scripts: false,
// GCC and Clang default to 8 for arm-none here
c_enum_min_bits: 8,
..Default::default()
},
}

View file

@ -28,6 +28,7 @@ pub fn target() -> Target {
max_atomic_width: Some(64),
panic_strategy: PanicStrategy::Abort,
emit_debug_gdb_scripts: false,
c_enum_min_bits: 8,
..Default::default()
};
Target {

View file

@ -19,6 +19,8 @@ pub fn target() -> Target {
max_atomic_width: Some(64),
panic_strategy: PanicStrategy::Abort,
emit_debug_gdb_scripts: false,
// GCC and Clang default to 8 for arm-none here
c_enum_min_bits: 8,
..Default::default()
};
Target {

View file

@ -19,6 +19,8 @@ pub fn target() -> Target {
panic_strategy: PanicStrategy::Abort,
max_atomic_width: Some(32),
emit_debug_gdb_scripts: false,
// GCC and Clang default to 8 for arm-none here
c_enum_min_bits: 8,
..Default::default()
},
}

View file

@ -20,6 +20,8 @@ pub fn target() -> Target {
features: "+vfp3,-d32,-fp16".to_string(),
max_atomic_width: Some(32),
emit_debug_gdb_scripts: false,
// GCC and Clang default to 8 for arm-none here
c_enum_min_bits: 8,
..Default::default()
},
}

View file

@ -53,6 +53,9 @@ pub fn opts() -> TargetOptions {
// LLVM is eager to trash the link register when calling `noreturn` functions, which
// breaks debugging. Preserve LR by default to prevent that from happening.
frame_pointer: FramePointer::Always,
// ARM supports multiple ABIs for enums, the linux one matches the default of 32 here
// but any arm-none or thumb-none target will be defaulted to 8 on GCC and clang
c_enum_min_bits: 8,
..Default::default()
}
}