Skip to content

Commit 97dbab9

Browse files
Rollup merge of #132741 - zmodem:mips_data_layout, r=nikic
Update mips64 data layout to match LLVM 20 change LLVM changed the data layout in llvm/llvm-project#112084
2 parents e2d429e + eb7d95b commit 97dbab9

8 files changed

+12
-7
lines changed

Diff for: compiler/rustc_codegen_llvm/src/context.rs

+5
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ pub(crate) unsafe fn create_module<'ll>(
154154
// See https://github.com/llvm/llvm-project/pull/106951
155155
target_data_layout = target_data_layout.replace("-i128:128", "");
156156
}
157+
if sess.target.arch.starts_with("mips64") {
158+
// LLVM 20 updates the mips64 layout to correctly align 128 bit integers to 128 bit.
159+
// See https://github.com/llvm/llvm-project/pull/112084
160+
target_data_layout = target_data_layout.replace("-i128:128", "");
161+
}
157162
}
158163

159164
// Ensure the data-layout values hardcoded remain the defaults.

Diff for: compiler/rustc_target/src/spec/targets/mips64_openwrt_linux_musl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
2020
std: None, // ?
2121
},
2222
pointer_width: 64,
23-
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".into(),
23+
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
2424
arch: "mips64".into(),
2525
options: TargetOptions {
2626
abi: "abi64".into(),

Diff for: compiler/rustc_target/src/spec/targets/mips64_unknown_linux_gnuabi64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
1111
std: Some(true),
1212
},
1313
pointer_width: 64,
14-
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".into(),
14+
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
1515
arch: "mips64".into(),
1616
options: TargetOptions {
1717
abi: "abi64".into(),

Diff for: compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
1616
std: Some(true),
1717
},
1818
pointer_width: 64,
19-
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".into(),
19+
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
2020
arch: "mips64".into(),
2121
options: TargetOptions {
2222
abi: "abi64".into(),

Diff for: compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_gnuabi64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub(crate) fn target() -> Target {
1010
std: Some(true),
1111
},
1212
pointer_width: 64,
13-
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".into(),
13+
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
1414
arch: "mips64".into(),
1515
options: TargetOptions {
1616
abi: "abi64".into(),

Diff for: compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_muslabi64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
1515
std: Some(true),
1616
},
1717
pointer_width: 64,
18-
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".into(),
18+
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
1919
arch: "mips64".into(),
2020
options: TargetOptions { abi: "abi64".into(), mcount: "_mcount".into(), ..base },
2121
}

Diff for: compiler/rustc_target/src/spec/targets/mipsisa64r6_unknown_linux_gnuabi64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
1111
std: None, // ?
1212
},
1313
pointer_width: 64,
14-
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".into(),
14+
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
1515
arch: "mips64r6".into(),
1616
options: TargetOptions {
1717
abi: "abi64".into(),

Diff for: compiler/rustc_target/src/spec/targets/mipsisa64r6el_unknown_linux_gnuabi64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub(crate) fn target() -> Target {
1010
std: Some(true),
1111
},
1212
pointer_width: 64,
13-
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".into(),
13+
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
1414
arch: "mips64r6".into(),
1515
options: TargetOptions {
1616
abi: "abi64".into(),

0 commit comments

Comments
 (0)