Skip to content

Commit c3fbafd

Browse files
committed
Update targets to use target_abi
All eabi targets have target_abi = "eabi". All eabihf targets have target_abi = "eabihf". armv6_unknown_freebsd and armv7_unknown_freebsd have target_abi = "eabihf". All abi64 targets have target_abi = "abi64". All ilp32 targets have target_abi = "ilp32". All softfloat targets have target_abi = "softfloat". All *-uwp-windows-* targets have target_abi = "uwp". All spe targets have target_abi = "spe". All macabi targets have target_abi = "macabi". aarch64-apple-ios-sim has target_abi = "sim". x86_64-fortanix-unknown-sgx has target_abi = "fortanix". x86_64-unknown-linux-gnux32 has target_abi = "x32". Add FIXME entries for targets for which existing values need to change once cfg_target_abi becomes stable. (All of them are tier 3 targets.) Add a test for target_abi in `--print cfg`.
1 parent 84d6e8a commit c3fbafd

File tree

53 files changed

+94
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+94
-7
lines changed

compiler/rustc_target/src/spec/aarch64_be_unknown_linux_gnu_ilp32.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ pub fn target() -> Target {
1010
pointer_width: 32,
1111
data_layout: "E-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
1212
arch: "aarch64".to_string(),
13-
options: TargetOptions { mcount: "\u{1}_mcount".to_string(), endian: Endian::Big, ..base },
13+
options: TargetOptions {
14+
abi: "ilp32".to_string(),
15+
mcount: "\u{1}_mcount".to_string(),
16+
endian: Endian::Big,
17+
..base
18+
},
1419
}
1520
}

compiler/rustc_target/src/spec/aarch64_unknown_linux_gnu_ilp32.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub fn target() -> Target {
77
data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
88
arch: "aarch64".to_string(),
99
options: TargetOptions {
10+
abi: "ilp32".to_string(),
1011
max_atomic_width: Some(128),
1112
mcount: "\u{1}_mcount".to_string(),
1213
..super::linux_gnu_base::opts()

compiler/rustc_target/src/spec/aarch64_unknown_none_softfloat.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOp
1010

1111
pub fn target() -> Target {
1212
let opts = TargetOptions {
13+
abi: "softfloat".to_string(),
1314
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
1415
linker: Some("rust-lld".to_owned()),
1516
features: "+strict-align,-neon,-fp-armv8".to_string(),

compiler/rustc_target/src/spec/apple_sdk_base.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ pub enum Arch {
1414
Arm64_sim,
1515
}
1616

17+
fn target_abi(arch: Arch) -> String {
18+
match arch {
19+
Armv7 | Armv7s | Arm64 | I386 | X86_64 => "",
20+
X86_64_macabi | Arm64_macabi => "macabi",
21+
Arm64_sim => "sim",
22+
}
23+
.to_string()
24+
}
25+
1726
fn target_cpu(arch: Arch) -> String {
1827
match arch {
1928
Armv7 => "cortex-a8", // iOS7 is supported on iPhone 4 and higher
@@ -39,6 +48,7 @@ fn link_env_remove(arch: Arch) -> Vec<String> {
3948

4049
pub fn opts(os: &str, arch: Arch) -> TargetOptions {
4150
TargetOptions {
51+
abi: target_abi(arch),
4252
cpu: target_cpu(arch),
4353
dynamic_linking: false,
4454
executables: true,

compiler/rustc_target/src/spec/arm_linux_androideabi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub fn target() -> Target {
77
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
88
arch: "arm".to_string(),
99
options: TargetOptions {
10+
abi: "eabi".to_string(),
1011
// https://developer.android.com/ndk/guides/abis.html#armeabi
1112
features: "+strict-align,+v5te".to_string(),
1213
max_atomic_width: Some(32),

compiler/rustc_target/src/spec/arm_unknown_linux_gnueabi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub fn target() -> Target {
77
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
88
arch: "arm".to_string(),
99
options: TargetOptions {
10+
abi: "eabi".to_string(),
1011
features: "+strict-align,+v6".to_string(),
1112
max_atomic_width: Some(64),
1213
mcount: "\u{1}__gnu_mcount_nc".to_string(),

compiler/rustc_target/src/spec/arm_unknown_linux_gnueabihf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub fn target() -> Target {
77
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
88
arch: "arm".to_string(),
99
options: TargetOptions {
10+
abi: "eabihf".to_string(),
1011
features: "+strict-align,+v6,+vfp2,-d32".to_string(),
1112
max_atomic_width: Some(64),
1213
mcount: "\u{1}__gnu_mcount_nc".to_string(),

compiler/rustc_target/src/spec/arm_unknown_linux_musleabi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub fn target() -> Target {
1010
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
1111
arch: "arm".to_string(),
1212
options: TargetOptions {
13+
abi: "eabi".to_string(),
1314
// Most of these settings are copied from the arm_unknown_linux_gnueabi
1415
// target.
1516
features: "+strict-align,+v6".to_string(),

compiler/rustc_target/src/spec/arm_unknown_linux_musleabihf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub fn target() -> Target {
1010
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
1111
arch: "arm".to_string(),
1212
options: TargetOptions {
13+
abi: "eabihf".to_string(),
1314
// Most of these settings are copied from the arm_unknown_linux_gnueabihf
1415
// target.
1516
features: "+strict-align,+v6,+vfp2,-d32".to_string(),

compiler/rustc_target/src/spec/armebv7r_none_eabi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pub fn target() -> Target {
1111
data_layout: "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
1212
arch: "arm".to_string(),
1313
options: TargetOptions {
14+
abi: "eabi".to_string(),
1415
endian: Endian::Big,
1516
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
1617
executables: true,

0 commit comments

Comments
 (0)