Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,13 @@ fn init_module<'ll, 'tcx>(tcx: TyCtxt<'tcx>, llcx: llvm::Context<'ll>, llmod: ll
target_data_layout = target_data_layout
.replace("-p10:32:32-p11:32:32-p12:32:32-p13:32:32-p14:32:32-p15:32:32", "");
}
if sess.target.arch == Arch::PowerPC64 && sess.target.os == Os::FreeBsd {
// LLVM 24 updated the powerpc64 FreeBSD layout to use 16-byte stack and vector
// alignment: https://github.com/llvm/llvm-project/pull/232336
if sess.target.arch == Arch::PowerPC64
&& matches!(sess.target.os, Os::FreeBsd | Os::OpenBsd)
{
// LLVM 24 updated the powerpc64 FreeBSD and OpenBSD layouts to use 16-byte stack and
// vector alignment:
// - https://github.com/llvm/llvm-project/pull/232336 (FreeBSD)
// - https://github.com/llvm/llvm-project/pull/245115 (OpenBSD)
target_data_layout = target_data_layout.replace("-S128-v256:256:256-v512:512:512", "");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub(crate) fn target() -> Target {
std: Some(true),
},
pointer_width: 64,
data_layout: "E-m:e-Fn32-i64:64-i128:128-n32:64".into(),
data_layout: "E-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
arch: Arch::PowerPC64,
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
}
Expand Down
Loading