Skip to content

Commit 074e6a7

Browse files
committed
rustc_target: ppc64 target string fixes for LLVM 20
LLVM continues to clean these up, and we continue to make this consistent. This is similar to 9caced7, e985396, and a10e744. `@rustbot` label: +llvm-main
1 parent de27914 commit 074e6a7

File tree

6 files changed

+10
-5
lines changed

6 files changed

+10
-5
lines changed

compiler/rustc_codegen_llvm/src/context.rs

+5
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ pub(crate) unsafe fn create_module<'ll>(
159159
// See https://github.com/llvm/llvm-project/pull/112084
160160
target_data_layout = target_data_layout.replace("-i128:128", "");
161161
}
162+
if sess.target.arch.starts_with("powerpc64") {
163+
// LLVM 20 updates the powerpc64 layout to correctly align 128 bit integers to 128 bit.
164+
// See https://github.com/llvm/llvm-project/pull/118004
165+
target_data_layout = target_data_layout.replace("-i128:128", "");
166+
}
162167
}
163168

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

compiler/rustc_target/src/spec/targets/powerpc64_ibm_aix.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
1919
std: None, // ?
2020
},
2121
pointer_width: 64,
22-
data_layout: "E-m:a-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
22+
data_layout: "E-m:a-Fi64-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
2323
arch: "powerpc64".into(),
2424
options: base,
2525
}

compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
1717
std: Some(true),
1818
},
1919
pointer_width: 64,
20-
data_layout: "E-m:e-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
20+
data_layout: "E-m:e-Fi64-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
2121
arch: "powerpc64".into(),
2222
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
2323
}

compiler/rustc_target/src/spec/targets/powerpc64_wrs_vxworks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
1717
std: Some(true),
1818
},
1919
pointer_width: 64,
20-
data_layout: "E-m:e-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
20+
data_layout: "E-m:e-Fi64-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
2121
arch: "powerpc64".into(),
2222
options: TargetOptions { endian: Endian::Big, ..base },
2323
}

compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.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-Fn32-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
19+
data_layout: "e-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
2020
arch: "powerpc64".into(),
2121
options: TargetOptions { mcount: "_mcount".into(), ..base },
2222
}

compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
1616
std: None, // ?
1717
},
1818
pointer_width: 64,
19-
data_layout: "e-m:e-Fn32-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
19+
data_layout: "e-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
2020
arch: "powerpc64".into(),
2121
options: TargetOptions { mcount: "_mcount".into(), ..base },
2222
}

0 commit comments

Comments
 (0)