From 86ab4a06ebd04151bf6aa48a546018be6386c158 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Wed, 13 Jul 2022 23:22:43 -0600 Subject: [PATCH 1/7] word-wrap the comments. --- compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs b/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs index 8d6130a8a79..f747e735f56 100644 --- a/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs +++ b/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs @@ -4,9 +4,17 @@ //! //! Please ping @Lokathor if changes are needed. //! -//! This target profile assumes that you have the ARM binutils in your path (specifically the linker, `arm-none-eabi-ld`). They can be obtained for free for all major OSes from the ARM developer's website, and they may also be available in your system's package manager. Unfortunately, the standard linker that Rust uses (`lld`) only supports as far back as `ARMv5TE`, so we must use the GNU `ld` linker. +//! This target profile assumes that you have the ARM binutils in your path +//! (specifically the linker, `arm-none-eabi-ld`). They can be obtained for free +//! for all major OSes from the ARM developer's website, and they may also be +//! available in your system's package manager. Unfortunately, the standard +//! linker that Rust uses (`lld`) only supports as far back as `ARMv5TE`, so we +//! must use the GNU `ld` linker. //! -//! **Important:** This target profile **does not** specify a linker script. You just get the default link script when you build a binary for this target. The default link script is very likely wrong, so you should use `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script. +//! **Important:** This target profile **does not** specify a linker script. You +//! just get the default link script when you build a binary for this target. +//! The default link script is very likely wrong, so you should use +//! `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script. use crate::spec::{cvs, LinkerFlavor, Target, TargetOptions}; From 7be0b877f4b188e81e6310cdc4e585f427501239 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Wed, 13 Jul 2022 23:24:57 -0600 Subject: [PATCH 2/7] Update thumbv4t_none_eabi.rs --- compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs b/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs index f747e735f56..e4bede3efbd 100644 --- a/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs +++ b/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs @@ -46,6 +46,13 @@ pub fn target() -> Target { // minimum extra features, these cannot be disabled via -C features: "+soft-float,+strict-align".into(), + + panic_strategy: PanicStrategy::Abort, + relocation_model: RelocModel::Static, + // suggested from thumb_base, rust-lang/rust#44993. + emit_debug_gdb_scripts: false, + // suggested from thumb_base, with no-os gcc/clang use 8-bit enums + c_enum_min_bits: 8, main_needs_argc_argv: false, @@ -53,7 +60,7 @@ pub fn target() -> Target { atomic_cas: false, has_thumb_interworking: true, - ..super::thumb_base::opts() + ..Default::default() }, } } From 6c22b44537005ffd0cfb8513c5ac09fe9906e13f Mon Sep 17 00:00:00 2001 From: Lokathor Date: Wed, 13 Jul 2022 23:37:08 -0600 Subject: [PATCH 3/7] add missing imports. --- compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs b/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs index e4bede3efbd..705340ad8ea 100644 --- a/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs +++ b/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs @@ -16,7 +16,7 @@ //! The default link script is very likely wrong, so you should use //! `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script. -use crate::spec::{cvs, LinkerFlavor, Target, TargetOptions}; +use crate::spec::{cvs, LinkerFlavor, Target, TargetOptions, PanicStrategy, RelocModel}; pub fn target() -> Target { Target { From 0e78c73b7403a9037838dc1ac2544725fc038003 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Wed, 13 Jul 2022 23:51:50 -0600 Subject: [PATCH 4/7] conform to the tidy expectations --- compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs b/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs index 705340ad8ea..8415ab0acf2 100644 --- a/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs +++ b/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs @@ -16,7 +16,7 @@ //! The default link script is very likely wrong, so you should use //! `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script. -use crate::spec::{cvs, LinkerFlavor, Target, TargetOptions, PanicStrategy, RelocModel}; +use crate::spec::{cvs, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions}; pub fn target() -> Target { Target { From 26e07879be269ba2f1b5f05fd34e45e4fcaf16b5 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Thu, 14 Jul 2022 00:03:59 -0600 Subject: [PATCH 5/7] tidy demands this whitespace go away --- compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs b/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs index 8415ab0acf2..11e89a84b74 100644 --- a/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs +++ b/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs @@ -46,7 +46,7 @@ pub fn target() -> Target { // minimum extra features, these cannot be disabled via -C features: "+soft-float,+strict-align".into(), - + panic_strategy: PanicStrategy::Abort, relocation_model: RelocModel::Static, // suggested from thumb_base, rust-lang/rust#44993. From 9cf5b2d81c9641ebf06cd9d0652cec92b5692916 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Thu, 28 Jul 2022 10:43:05 -0600 Subject: [PATCH 6/7] Update thumbv4t_none_eabi.rs --- compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs b/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs index 11e89a84b74..8fed1b58eba 100644 --- a/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs +++ b/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs @@ -16,7 +16,7 @@ //! The default link script is very likely wrong, so you should use //! `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script. -use crate::spec::{cvs, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions}; +use crate::spec::{cvs, LinkerFlavor, FramePointer, PanicStrategy, RelocModel, Target, TargetOptions}; pub fn target() -> Target { Target { @@ -53,6 +53,7 @@ pub fn target() -> Target { emit_debug_gdb_scripts: false, // suggested from thumb_base, with no-os gcc/clang use 8-bit enums c_enum_min_bits: 8, + frame_pointer: FramePointer::MayOmit, main_needs_argc_argv: false, @@ -60,7 +61,7 @@ pub fn target() -> Target { atomic_cas: false, has_thumb_interworking: true, - ..Default::default() + ..super::thumb_base::opts() }, } } From 2eac6f30c8a1cd59dc640bf68bc58eb7fe656d61 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Thu, 28 Jul 2022 10:58:42 -0600 Subject: [PATCH 7/7] once again tidy was unhappy --- compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs b/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs index 8fed1b58eba..7125d141af7 100644 --- a/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs +++ b/compiler/rustc_target/src/spec/thumbv4t_none_eabi.rs @@ -16,7 +16,9 @@ //! The default link script is very likely wrong, so you should use //! `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script. -use crate::spec::{cvs, LinkerFlavor, FramePointer, PanicStrategy, RelocModel, Target, TargetOptions}; +use crate::spec::{ + cvs, FramePointer, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions, +}; pub fn target() -> Target { Target {