rustc_target: Do not specify some target options redundantly

These values are already inherited
This commit is contained in:
Vadim Petrochenkov 2022-08-14 19:11:31 +03:00
parent 2e83c22154
commit f0d0573db1
6 changed files with 3 additions and 12 deletions

View File

@ -18,7 +18,6 @@ pub fn target() -> Target {
panic_strategy: PanicStrategy::Abort, panic_strategy: PanicStrategy::Abort,
position_independent_executables: true, position_independent_executables: true,
dynamic_linking: true, dynamic_linking: true,
executables: true,
relro_level: RelroLevel::Off, relro_level: RelroLevel::Off,
..Default::default() ..Default::default()
}, },

View File

@ -4,7 +4,6 @@ pub fn opts() -> TargetOptions {
let mut base = super::linux_base::opts(); let mut base = super::linux_base::opts();
base.os = "android".into(); base.os = "android".into();
base.default_dwarf_version = 2; base.default_dwarf_version = 2;
base.position_independent_executables = true;
base.has_thread_local = false; base.has_thread_local = false;
// This is for backward compatibility, see https://github.com/rust-lang/rust/issues/49867 // This is for backward compatibility, see https://github.com/rust-lang/rust/issues/49867
// for context. (At that time, there was no `-C force-unwind-tables`, so the only solution // for context. (At that time, there was no `-C force-unwind-tables`, so the only solution

View File

@ -10,7 +10,6 @@ pub fn target() -> Target {
base.crt_static_default = false; base.crt_static_default = false;
base.has_rpath = true; base.has_rpath = true;
base.linker_is_gnu = false; base.linker_is_gnu = false;
base.dynamic_linking = true;
base.c_enum_min_bits = 8; base.c_enum_min_bits = 8;

View File

@ -1,5 +1,5 @@
use crate::abi::Endian; use crate::abi::Endian;
use crate::spec::{LinkerFlavor, RelocModel, Target, TargetOptions}; use crate::spec::{LinkerFlavor, Target, TargetOptions};
pub fn target() -> Target { pub fn target() -> Target {
let mut base = super::freebsd_base::opts(); let mut base = super::freebsd_base::opts();
@ -15,7 +15,6 @@ pub fn target() -> Target {
options: TargetOptions { options: TargetOptions {
endian: Endian::Big, endian: Endian::Big,
features: "+secure-plt".into(), features: "+secure-plt".into(),
relocation_model: RelocModel::Pic,
mcount: "_mcount".into(), mcount: "_mcount".into(),
..base ..base
}, },

View File

@ -4,8 +4,6 @@ pub fn target() -> Target {
let mut base = super::l4re_base::opts(); let mut base = super::l4re_base::opts();
base.cpu = "x86-64".into(); base.cpu = "x86-64".into();
base.max_atomic_width = Some(64); base.max_atomic_width = Some(64);
base.crt_static_allows_dylibs = false;
base.dynamic_linking = false;
base.panic_strategy = PanicStrategy::Abort; base.panic_strategy = PanicStrategy::Abort;
Target { Target {

View File

@ -4,10 +4,8 @@
// `target-cpu` compiler flags to opt-in more hardware-specific // `target-cpu` compiler flags to opt-in more hardware-specific
// features. // features.
use super::{ use super::{CodeModel, LinkerFlavor, LldFlavor, PanicStrategy};
CodeModel, LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, RelroLevel, StackProbeType, use super::{RelroLevel, StackProbeType, Target, TargetOptions};
Target, TargetOptions,
};
pub fn target() -> Target { pub fn target() -> Target {
let opts = TargetOptions { let opts = TargetOptions {
@ -18,7 +16,6 @@ pub fn target() -> Target {
position_independent_executables: true, position_independent_executables: true,
static_position_independent_executables: true, static_position_independent_executables: true,
relro_level: RelroLevel::Full, relro_level: RelroLevel::Full,
relocation_model: RelocModel::Pic,
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld), linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
linker: Some("rust-lld".into()), linker: Some("rust-lld".into()),
features: features: