Skip to content

Commit 5ac0ae4

Browse files
Rollup merge of #78929 - petrochenkov:linuxbase, r=joshtriplett
rustc_target: Move target env "gnu" from `linux_base` to `linux_gnu_base` Follow up to #77729. Changes the target spec hierarchy for Linux from ``` linux_base ├── linux_musl_base └── linux_uclibc_base ``` where `linux_base` is really `linux_gnu_base` and the inheriting targets replace target env "gnu" with "musl"/"uclibc" to ``` linux_base ├── linux_gnu_base ├── linux_musl_base └── linux_uclibc_base ``` which is slightly less confusing (I think).
2 parents a8a0c65 + ca17a91 commit 5ac0ae4

32 files changed

+35
-30
lines changed

compiler/rustc_target/src/spec/aarch64_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::spec::{Target, TargetOptions};
22

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

77
Target {

compiler/rustc_target/src/spec/android_base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::spec::{LinkerFlavor, TargetOptions};
22

33
pub fn opts() -> TargetOptions {
4-
let mut base = super::linux_base::opts();
4+
let mut base = super::linux_gnu_base::opts();
55
base.os = "android".to_string();
66
// Many of the symbols defined in compiler-rt are also defined in libgcc.
77
// Android's linker doesn't like that by default.

compiler/rustc_target/src/spec/arm_unknown_linux_gnueabi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::spec::{Target, TargetOptions};
22

33
pub fn target() -> Target {
4-
let mut base = super::linux_base::opts();
4+
let mut base = super::linux_gnu_base::opts();
55
base.max_atomic_width = Some(64);
66
Target {
77
llvm_target: "arm-unknown-linux-gnueabi".to_string(),

compiler/rustc_target/src/spec/arm_unknown_linux_gnueabihf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::spec::{Target, TargetOptions};
22

33
pub fn target() -> Target {
4-
let mut base = super::linux_base::opts();
4+
let mut base = super::linux_gnu_base::opts();
55
base.max_atomic_width = Some(64);
66
Target {
77
llvm_target: "arm-unknown-linux-gnueabihf".to_string(),

compiler/rustc_target/src/spec/armv4t_unknown_linux_gnueabi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::spec::{Target, TargetOptions};
22

33
pub fn target() -> Target {
4-
let base = super::linux_base::opts();
4+
let base = super::linux_gnu_base::opts();
55
Target {
66
llvm_target: "armv4t-unknown-linux-gnueabi".to_string(),
77
pointer_width: 32,

compiler/rustc_target/src/spec/armv5te_unknown_linux_gnueabi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::spec::{Target, TargetOptions};
22

33
pub fn target() -> Target {
4-
let base = super::linux_base::opts();
4+
let base = super::linux_gnu_base::opts();
55
Target {
66
llvm_target: "armv5te-unknown-linux-gnueabi".to_string(),
77
pointer_width: 32,

compiler/rustc_target/src/spec/armv7_unknown_linux_gnueabi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::spec::{Target, TargetOptions};
44
// hardfloat.
55

66
pub fn target() -> Target {
7-
let base = super::linux_base::opts();
7+
let base = super::linux_gnu_base::opts();
88
Target {
99
llvm_target: "armv7-unknown-linux-gnueabi".to_string(),
1010
pointer_width: 32,

compiler/rustc_target/src/spec/armv7_unknown_linux_gnueabihf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::spec::{Target, TargetOptions};
44
// thumb-mode. See the thumbv7neon variant for enabling both.
55

66
pub fn target() -> Target {
7-
let base = super::linux_base::opts();
7+
let base = super::linux_gnu_base::opts();
88
Target {
99
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
1010
pointer_width: 32,

compiler/rustc_target/src/spec/i686_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::spec::{LinkerFlavor, Target};
22

33
pub fn target() -> Target {
4-
let mut base = super::linux_base::opts();
4+
let mut base = super::linux_gnu_base::opts();
55
base.cpu = "pentium4".to_string();
66
base.max_atomic_width = Some(64);
77
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());

compiler/rustc_target/src/spec/linux_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ pub fn opts() -> TargetOptions {
2020

2121
TargetOptions {
2222
os: "linux".to_string(),
23-
env: "gnu".to_string(),
2423
dynamic_linking: true,
2524
executables: true,
2625
os_family: Some("unix".to_string()),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
use crate::spec::TargetOptions;
2+
3+
pub fn opts() -> TargetOptions {
4+
TargetOptions { env: "gnu".to_string(), ..super::linux_base::opts() }
5+
}

compiler/rustc_target/src/spec/mips64_unknown_linux_gnuabi64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub fn target() -> Target {
1414
max_atomic_width: Some(64),
1515
mcount: "_mcount".to_string(),
1616

17-
..super::linux_base::opts()
17+
..super::linux_gnu_base::opts()
1818
},
1919
}
2020
}

compiler/rustc_target/src/spec/mips64el_unknown_linux_gnuabi64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
1313
max_atomic_width: Some(64),
1414
mcount: "_mcount".to_string(),
1515

16-
..super::linux_base::opts()
16+
..super::linux_gnu_base::opts()
1717
},
1818
}
1919
}

compiler/rustc_target/src/spec/mips_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
1313
max_atomic_width: Some(32),
1414
mcount: "_mcount".to_string(),
1515

16-
..super::linux_base::opts()
16+
..super::linux_gnu_base::opts()
1717
},
1818
}
1919
}

compiler/rustc_target/src/spec/mipsel_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
1313
max_atomic_width: Some(32),
1414
mcount: "_mcount".to_string(),
1515

16-
..super::linux_base::opts()
16+
..super::linux_gnu_base::opts()
1717
},
1818
}
1919
}

compiler/rustc_target/src/spec/mipsisa32r6_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
1313
max_atomic_width: Some(32),
1414
mcount: "_mcount".to_string(),
1515

16-
..super::linux_base::opts()
16+
..super::linux_gnu_base::opts()
1717
},
1818
}
1919
}

compiler/rustc_target/src/spec/mipsisa32r6el_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
1313
max_atomic_width: Some(32),
1414
mcount: "_mcount".to_string(),
1515

16-
..super::linux_base::opts()
16+
..super::linux_gnu_base::opts()
1717
},
1818
}
1919
}

compiler/rustc_target/src/spec/mipsisa64r6_unknown_linux_gnuabi64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub fn target() -> Target {
1414
max_atomic_width: Some(64),
1515
mcount: "_mcount".to_string(),
1616

17-
..super::linux_base::opts()
17+
..super::linux_gnu_base::opts()
1818
},
1919
}
2020
}

compiler/rustc_target/src/spec/mipsisa64r6el_unknown_linux_gnuabi64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
1313
max_atomic_width: Some(64),
1414
mcount: "_mcount".to_string(),
1515

16-
..super::linux_base::opts()
16+
..super::linux_gnu_base::opts()
1717
},
1818
}
1919
}

compiler/rustc_target/src/spec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ mod hermit_kernel_base;
6464
mod illumos_base;
6565
mod l4re_base;
6666
mod linux_base;
67+
mod linux_gnu_base;
6768
mod linux_kernel_base;
6869
mod linux_musl_base;
6970
mod linux_uclibc_base;

compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions};
22

33
pub fn target() -> Target {
4-
let mut base = super::linux_base::opts();
4+
let mut base = super::linux_gnu_base::opts();
55
base.cpu = "ppc64".to_string();
66
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
77
base.max_atomic_width = Some(64);

compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs

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

33
pub fn target() -> Target {
4-
let mut base = super::linux_base::opts();
4+
let mut base = super::linux_gnu_base::opts();
55
base.cpu = "ppc64le".to_string();
66
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
77
base.max_atomic_width = Some(64);

compiler/rustc_target/src/spec/powerpc_unknown_linux_gnu.rs

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

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

compiler/rustc_target/src/spec/powerpc_unknown_linux_gnuspe.rs

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

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

compiler/rustc_target/src/spec/riscv32gc_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
1313
features: "+m,+a,+f,+d,+c".to_string(),
1414
llvm_abiname: "ilp32d".to_string(),
1515
max_atomic_width: Some(32),
16-
..super::linux_base::opts()
16+
..super::linux_gnu_base::opts()
1717
},
1818
}
1919
}

compiler/rustc_target/src/spec/riscv64gc_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
1313
features: "+m,+a,+f,+d,+c".to_string(),
1414
llvm_abiname: "lp64d".to_string(),
1515
max_atomic_width: Some(64),
16-
..super::linux_base::opts()
16+
..super::linux_gnu_base::opts()
1717
},
1818
}
1919
}

compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::spec::Target;
22

33
pub fn target() -> Target {
4-
let mut base = super::linux_base::opts();
4+
let mut base = super::linux_gnu_base::opts();
55
base.endian = "big".to_string();
66
// z10 is the oldest CPU supported by LLVM
77
base.cpu = "z10".to_string();

compiler/rustc_target/src/spec/sparc64_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::spec::Target;
22

33
pub fn target() -> Target {
4-
let mut base = super::linux_base::opts();
4+
let mut base = super::linux_gnu_base::opts();
55
base.endian = "big".to_string();
66
base.cpu = "v9".to_string();
77
base.max_atomic_width = Some(64);

compiler/rustc_target/src/spec/sparc_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::spec::{LinkerFlavor, Target};
22

33
pub fn target() -> Target {
4-
let mut base = super::linux_base::opts();
4+
let mut base = super::linux_gnu_base::opts();
55
base.endian = "big".to_string();
66
base.cpu = "v9".to_string();
77
base.max_atomic_width = Some(64);

compiler/rustc_target/src/spec/thumbv7neon_unknown_linux_gnueabihf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::spec::{Target, TargetOptions};
77
// https://static.docs.arm.com/ddi0406/cd/DDI0406C_d_armv7ar_arm.pdf
88

99
pub fn target() -> Target {
10-
let base = super::linux_base::opts();
10+
let base = super::linux_gnu_base::opts();
1111
Target {
1212
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
1313
pointer_width: 32,

compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::spec::{LinkerFlavor, Target};
22

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

compiler/rustc_target/src/spec/x86_64_unknown_linux_gnux32.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::spec::{LinkerFlavor, Target};
22

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

0 commit comments

Comments
 (0)