Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc_target: Move target env "gnu" from linux_base to linux_gnu_base #78929

Merged
merged 1 commit into from
Nov 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::{Target, TargetOptions};

pub fn target() -> Target {
let mut base = super::linux_base::opts();
let mut base = super::linux_gnu_base::opts();
base.max_atomic_width = Some(128);

Target {
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/android_base.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::{LinkerFlavor, TargetOptions};

pub fn opts() -> TargetOptions {
let mut base = super::linux_base::opts();
let mut base = super::linux_gnu_base::opts();
base.os = "android".to_string();
// Many of the symbols defined in compiler-rt are also defined in libgcc.
// Android's linker doesn't like that by default.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::{Target, TargetOptions};

pub fn target() -> Target {
let mut base = super::linux_base::opts();
let mut base = super::linux_gnu_base::opts();
base.max_atomic_width = Some(64);
Target {
llvm_target: "arm-unknown-linux-gnueabi".to_string(),
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::{Target, TargetOptions};

pub fn target() -> Target {
let mut base = super::linux_base::opts();
let mut base = super::linux_gnu_base::opts();
base.max_atomic_width = Some(64);
Target {
llvm_target: "arm-unknown-linux-gnueabihf".to_string(),
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::{Target, TargetOptions};

pub fn target() -> Target {
let base = super::linux_base::opts();
let base = super::linux_gnu_base::opts();
Target {
llvm_target: "armv4t-unknown-linux-gnueabi".to_string(),
pointer_width: 32,
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::{Target, TargetOptions};

pub fn target() -> Target {
let base = super::linux_base::opts();
let base = super::linux_gnu_base::opts();
Target {
llvm_target: "armv5te-unknown-linux-gnueabi".to_string(),
pointer_width: 32,
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ use crate::spec::{Target, TargetOptions};
// hardfloat.

pub fn target() -> Target {
let base = super::linux_base::opts();
let base = super::linux_gnu_base::opts();
Target {
llvm_target: "armv7-unknown-linux-gnueabi".to_string(),
pointer_width: 32,
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ use crate::spec::{Target, TargetOptions};
// thumb-mode. See the thumbv7neon variant for enabling both.

pub fn target() -> Target {
let base = super::linux_base::opts();
let base = super::linux_gnu_base::opts();
Target {
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
pointer_width: 32,
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/i686_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::{LinkerFlavor, Target};

pub fn target() -> Target {
let mut base = super::linux_base::opts();
let mut base = super::linux_gnu_base::opts();
base.cpu = "pentium4".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
1 change: 0 additions & 1 deletion compiler/rustc_target/src/spec/linux_base.rs
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@ pub fn opts() -> TargetOptions {

TargetOptions {
os: "linux".to_string(),
env: "gnu".to_string(),
dynamic_linking: true,
executables: true,
os_family: Some("unix".to_string()),
5 changes: 5 additions & 0 deletions compiler/rustc_target/src/spec/linux_gnu_base.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use crate::spec::TargetOptions;

pub fn opts() -> TargetOptions {
TargetOptions { env: "gnu".to_string(), ..super::linux_base::opts() }
}
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ pub fn target() -> Target {
max_atomic_width: Some(64),
mcount: "_mcount".to_string(),

..super::linux_base::opts()
..super::linux_gnu_base::opts()
},
}
}
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
max_atomic_width: Some(64),
mcount: "_mcount".to_string(),

..super::linux_base::opts()
..super::linux_gnu_base::opts()
},
}
}
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/mips_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
max_atomic_width: Some(32),
mcount: "_mcount".to_string(),

..super::linux_base::opts()
..super::linux_gnu_base::opts()
},
}
}
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/mipsel_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
max_atomic_width: Some(32),
mcount: "_mcount".to_string(),

..super::linux_base::opts()
..super::linux_gnu_base::opts()
},
}
}
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
max_atomic_width: Some(32),
mcount: "_mcount".to_string(),

..super::linux_base::opts()
..super::linux_gnu_base::opts()
},
}
}
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
max_atomic_width: Some(32),
mcount: "_mcount".to_string(),

..super::linux_base::opts()
..super::linux_gnu_base::opts()
},
}
}
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ pub fn target() -> Target {
max_atomic_width: Some(64),
mcount: "_mcount".to_string(),

..super::linux_base::opts()
..super::linux_gnu_base::opts()
},
}
}
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
max_atomic_width: Some(64),
mcount: "_mcount".to_string(),

..super::linux_base::opts()
..super::linux_gnu_base::opts()
},
}
}
1 change: 1 addition & 0 deletions compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
@@ -64,6 +64,7 @@ mod hermit_kernel_base;
mod illumos_base;
mod l4re_base;
mod linux_base;
mod linux_gnu_base;
mod linux_kernel_base;
mod linux_musl_base;
mod linux_uclibc_base;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions};

pub fn target() -> Target {
let mut base = super::linux_base::opts();
let mut base = super::linux_gnu_base::opts();
base.cpu = "ppc64".to_string();
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::{LinkerFlavor, Target, TargetOptions};

pub fn target() -> Target {
let mut base = super::linux_base::opts();
let mut base = super::linux_gnu_base::opts();
base.cpu = "ppc64le".to_string();
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::{LinkerFlavor, Target, TargetOptions};

pub fn target() -> Target {
let mut base = super::linux_base::opts();
let mut base = super::linux_gnu_base::opts();
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
base.max_atomic_width = Some(32);

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::{LinkerFlavor, Target, TargetOptions};

pub fn target() -> Target {
let mut base = super::linux_base::opts();
let mut base = super::linux_gnu_base::opts();
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mspe".to_string());
base.max_atomic_width = Some(32);

Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
features: "+m,+a,+f,+d,+c".to_string(),
llvm_abiname: "ilp32d".to_string(),
max_atomic_width: Some(32),
..super::linux_base::opts()
..super::linux_gnu_base::opts()
},
}
}
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
features: "+m,+a,+f,+d,+c".to_string(),
llvm_abiname: "lp64d".to_string(),
max_atomic_width: Some(64),
..super::linux_base::opts()
..super::linux_gnu_base::opts()
},
}
}
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::Target;

pub fn target() -> Target {
let mut base = super::linux_base::opts();
let mut base = super::linux_gnu_base::opts();
base.endian = "big".to_string();
// z10 is the oldest CPU supported by LLVM
base.cpu = "z10".to_string();
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::Target;

pub fn target() -> Target {
let mut base = super::linux_base::opts();
let mut base = super::linux_gnu_base::opts();
base.endian = "big".to_string();
base.cpu = "v9".to_string();
base.max_atomic_width = Some(64);
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/sparc_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::{LinkerFlavor, Target};

pub fn target() -> Target {
let mut base = super::linux_base::opts();
let mut base = super::linux_gnu_base::opts();
base.endian = "big".to_string();
base.cpu = "v9".to_string();
base.max_atomic_width = Some(64);
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ use crate::spec::{Target, TargetOptions};
// https://static.docs.arm.com/ddi0406/cd/DDI0406C_d_armv7ar_arm.pdf

pub fn target() -> Target {
let base = super::linux_base::opts();
let base = super::linux_gnu_base::opts();
Target {
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
pointer_width: 32,
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::{LinkerFlavor, Target};

pub fn target() -> Target {
let mut base = super::linux_base::opts();
let mut base = super::linux_gnu_base::opts();
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::spec::{LinkerFlavor, Target};

pub fn target() -> Target {
let mut base = super::linux_base::opts();
let mut base = super::linux_gnu_base::opts();
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mx32".to_string());