Update powerpc data layouts

Function pointer alignment is specified since https://reviews.llvm.org/D147016.
This commit is contained in:
Nikita Popov 2023-07-25 11:24:01 +02:00 committed by Nikita Popov
parent 055dd282c5
commit ad7ea8b7e6
18 changed files with 28 additions and 17 deletions

View File

@ -145,6 +145,17 @@ pub unsafe fn create_module<'ll>(
target_data_layout = target_data_layout.replace("-n32:64-", "-n64-");
}
}
if llvm_version < (17, 0, 0) {
if sess.target.arch.starts_with("powerpc") {
// LLVM 17 specifies function pointer alignment for ppc:
// https://reviews.llvm.org/D147016
target_data_layout = target_data_layout
.replace("-Fn32", "")
.replace("-Fi32", "")
.replace("-Fn64", "")
.replace("-Fi64", "");
}
}
// Ensure the data-layout values hardcoded remain the defaults.
if sess.target.is_builtin {

View File

@ -11,7 +11,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64-ibm-aix".into(),
pointer_width: 64,
data_layout: "E-m:a-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
data_layout: "E-m:a-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
arch: "powerpc64".into(),
options: base,
}

View File

@ -11,7 +11,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64-unknown-freebsd".into(),
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64".into(),
data_layout: "E-m:e-Fn32-i64:64-n32:64".into(),
arch: "powerpc64".into(),
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
}

View File

@ -11,7 +11,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64-unknown-linux-gnu".into(),
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
data_layout: "E-m:e-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
arch: "powerpc64".into(),
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
}

View File

@ -11,7 +11,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64-unknown-linux-musl".into(),
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
data_layout: "E-m:e-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
arch: "powerpc64".into(),
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
}

View File

@ -11,7 +11,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64-unknown-openbsd".into(),
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64".into(),
data_layout: "E-m:e-Fn32-i64:64-n32:64".into(),
arch: "powerpc64".into(),
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
}

View File

@ -11,7 +11,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64-unknown-linux-gnu".into(),
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
data_layout: "E-m:e-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
arch: "powerpc64".into(),
options: TargetOptions { endian: Endian::Big, ..base },
}

View File

@ -10,7 +10,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64le-unknown-freebsd".into(),
pointer_width: 64,
data_layout: "e-m:e-i64:64-n32:64".into(),
data_layout: "e-m:e-Fn32-i64:64-n32:64".into(),
arch: "powerpc64".into(),
options: TargetOptions { mcount: "_mcount".into(), ..base },
}

View File

@ -10,7 +10,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64le-unknown-linux-gnu".into(),
pointer_width: 64,
data_layout: "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
data_layout: "e-m:e-Fn32-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
arch: "powerpc64".into(),
options: TargetOptions { mcount: "_mcount".into(), ..base },
}

View File

@ -10,7 +10,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64le-unknown-linux-musl".into(),
pointer_width: 64,
data_layout: "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
data_layout: "e-m:e-Fn32-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
arch: "powerpc64".into(),
options: TargetOptions { mcount: "_mcount".into(), ..base },
}

View File

@ -14,7 +14,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc-unknown-freebsd13.0".into(),
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-n32".into(),
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
arch: "powerpc".into(),
options: TargetOptions {
endian: Endian::Big,

View File

@ -10,7 +10,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc-unknown-linux-gnu".into(),
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-n32".into(),
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
arch: "powerpc".into(),
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
}

View File

@ -10,7 +10,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc-unknown-linux-gnuspe".into(),
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-n32".into(),
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
arch: "powerpc".into(),
options: TargetOptions {
abi: "spe".into(),

View File

@ -10,7 +10,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc-unknown-linux-musl".into(),
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-n32".into(),
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
arch: "powerpc".into(),
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
}

View File

@ -10,7 +10,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc-unknown-netbsd".into(),
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-n32".into(),
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
arch: "powerpc".into(),
options: TargetOptions { endian: Endian::Big, mcount: "__mcount".into(), ..base },
}

View File

@ -10,7 +10,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc-unknown-openbsd".into(),
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-n32".into(),
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
arch: "powerpc".into(),
options: base,
}

View File

@ -10,7 +10,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc-unknown-linux-gnu".into(),
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-n32".into(),
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
arch: "powerpc".into(),
options: TargetOptions { endian: Endian::Big, features: "+secure-plt".into(), ..base },
}

View File

@ -10,7 +10,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc-unknown-linux-gnuspe".into(),
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-n32".into(),
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
arch: "powerpc".into(),
options: TargetOptions {
abi: "spe".into(),