Skip to content

Commit

Permalink
rustc_target: Do not specify some target options redundantly
Browse files Browse the repository at this point in the history
These values are already inherited
  • Loading branch information
petrochenkov committed Aug 27, 2022
1 parent 2e83c22 commit f0d0573
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ pub fn target() -> Target {
panic_strategy: PanicStrategy::Abort,
position_independent_executables: true,
dynamic_linking: true,
executables: true,
relro_level: RelroLevel::Off,
..Default::default()
},
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_target/src/spec/android_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pub fn opts() -> TargetOptions {
let mut base = super::linux_base::opts();
base.os = "android".into();
base.default_dwarf_version = 2;
base.position_independent_executables = true;
base.has_thread_local = false;
// 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub fn target() -> Target {
base.crt_static_default = false;
base.has_rpath = true;
base.linker_is_gnu = false;
base.dynamic_linking = true;

base.c_enum_min_bits = 8;

Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_target/src/spec/powerpc_unknown_freebsd.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, RelocModel, Target, TargetOptions};
use crate::spec::{LinkerFlavor, Target, TargetOptions};

pub fn target() -> Target {
let mut base = super::freebsd_base::opts();
Expand All @@ -15,7 +15,6 @@ pub fn target() -> Target {
options: TargetOptions {
endian: Endian::Big,
features: "+secure-plt".into(),
relocation_model: RelocModel::Pic,
mcount: "_mcount".into(),
..base
},
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_target/src/spec/x86_64_unknown_l4re_uclibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ pub fn target() -> Target {
let mut base = super::l4re_base::opts();
base.cpu = "x86-64".into();
base.max_atomic_width = Some(64);
base.crt_static_allows_dylibs = false;
base.dynamic_linking = false;
base.panic_strategy = PanicStrategy::Abort;

Target {
Expand Down
7 changes: 2 additions & 5 deletions compiler/rustc_target/src/spec/x86_64_unknown_none.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
// `target-cpu` compiler flags to opt-in more hardware-specific
// features.

use super::{
CodeModel, LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, RelroLevel, StackProbeType,
Target, TargetOptions,
};
use super::{CodeModel, LinkerFlavor, LldFlavor, PanicStrategy};
use super::{RelroLevel, StackProbeType, Target, TargetOptions};

pub fn target() -> Target {
let opts = TargetOptions {
Expand All @@ -18,7 +16,6 @@ pub fn target() -> Target {
position_independent_executables: true,
static_position_independent_executables: true,
relro_level: RelroLevel::Full,
relocation_model: RelocModel::Pic,
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
linker: Some("rust-lld".into()),
features:
Expand Down

0 comments on commit f0d0573

Please sign in to comment.