mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-25 13:24:22 +00:00
Update data layout for 32-bit msvc targets
https://reviews.llvm.org/D115942 changed the alignment of f80.
This commit is contained in:
parent
f34914141e
commit
a380581ff8
@ -134,7 +134,8 @@ pub unsafe fn create_module<'ll>(
|
||||
let llmod = llvm::LLVMModuleCreateWithNameInContext(mod_name.as_ptr(), llcx);
|
||||
|
||||
let mut target_data_layout = sess.target.data_layout.clone();
|
||||
if llvm_util::get_version() < (13, 0, 0) {
|
||||
let llvm_version = llvm_util::get_version();
|
||||
if llvm_version < (13, 0, 0) {
|
||||
if sess.target.arch == "powerpc64" {
|
||||
target_data_layout = target_data_layout.replace("-S128", "");
|
||||
}
|
||||
@ -145,6 +146,15 @@ pub unsafe fn create_module<'ll>(
|
||||
target_data_layout = "e-m:e-p:64:64-i64:64-n32:64-S128".to_string();
|
||||
}
|
||||
}
|
||||
if llvm_version < (14, 0, 0) {
|
||||
if sess.target.llvm_target == "i686-pc-windows-msvc"
|
||||
|| sess.target.llvm_target == "i586-pc-windows-msvc"
|
||||
{
|
||||
target_data_layout =
|
||||
"e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32"
|
||||
.to_string();
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure the data-layout values hardcoded remain the defaults.
|
||||
if sess.target.is_builtin {
|
||||
|
@ -24,7 +24,7 @@ pub fn target() -> Target {
|
||||
llvm_target: "i686-pc-windows-msvc".to_string(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
||||
i64:64-f80:32-n8:16:32-a:0:32-S32"
|
||||
i64:64-f80:128-n8:16:32-a:0:32-S32"
|
||||
.to_string(),
|
||||
arch: "x86".to_string(),
|
||||
options: base,
|
||||
|
@ -9,7 +9,7 @@ pub fn target() -> Target {
|
||||
llvm_target: "i686-pc-windows-msvc".to_string(),
|
||||
pointer_width: 32,
|
||||
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
|
||||
i64:64-f80:32-n8:16:32-a:0:32-S32"
|
||||
i64:64-f80:128-n8:16:32-a:0:32-S32"
|
||||
.to_string(),
|
||||
arch: "x86".to_string(),
|
||||
options: base,
|
||||
|
Loading…
Reference in New Issue
Block a user