Skip to content

Commit a2741a5

Browse files
Rollup merge of #166118 - durin42:llvm-24-ppc64le-unk-bsd-data-layout, r=mati865
rustc_target: catch up with LLVM 24 movement on ppc64le bsd data layout Changed in LLVM today: llvm/llvm-project#232336 @rustbot label: +llvm-main
2 parents 2ce8ec0 + 711c0ce commit a2741a5

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎compiler/rustc_codegen_llvm/src/context.rs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ fn init_module<'ll, 'tcx>(tcx: TyCtxt<'tcx>, llcx: llvm::Context<'ll>, llmod: ll
214214
target_data_layout = target_data_layout
215215
.replace("-p10:32:32-p11:32:32-p12:32:32-p13:32:32-p14:32:32-p15:32:32", "");
216216
}
217+
if sess.target.arch == Arch::PowerPC64 && sess.target.os == Os::FreeBsd {
218+
// LLVM 24 updated the powerpc64 FreeBSD layout to use 16-byte stack and vector
219+
// alignment: https://github.com/llvm/llvm-project/pull/232336
220+
target_data_layout = target_data_layout.replace("-S128-v256:256:256-v512:512:512", "");
221+
}
217222
}
218223
// Ensure the data-layout values hardcoded remain the defaults.
219224
{

‎compiler/rustc_target/src/spec/targets/powerpc64_unknown_freebsd.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
2323
std: Some(true),
2424
},
2525
pointer_width: 64,
26-
data_layout: "E-m:e-Fn32-i64:64-i128:128-n32:64".into(),
26+
data_layout: "E-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
2727
arch: Arch::PowerPC64,
2828
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
2929
}

‎compiler/rustc_target/src/spec/targets/powerpc64le_unknown_freebsd.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
2424
std: Some(true),
2525
},
2626
pointer_width: 64,
27-
data_layout: "e-m:e-Fn32-i64:64-i128:128-n32:64".into(),
27+
data_layout: "e-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
2828
arch: Arch::PowerPC64,
2929
options: TargetOptions { mcount: "_mcount".into(), ..base },
3030
}

0 commit comments

Comments
 (0)