Rollup merge of #134165 - durin42:wasm-target-string, r=jieyouxu

wasm(32|64): update alignment string

See llvm/llvm-project@c5ab70c508

`@rustbot` label: +llvm-main
This commit is contained in:
Matthias Krüger 2024-12-11 20:00:21 +01:00 committed by GitHub
commit eefefbea2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 13 additions and 7 deletions

View file

@ -164,6 +164,11 @@ pub(crate) unsafe fn create_module<'ll>(
// See https://github.com/llvm/llvm-project/pull/118004 // See https://github.com/llvm/llvm-project/pull/118004
target_data_layout = target_data_layout.replace("-i128:128", ""); target_data_layout = target_data_layout.replace("-i128:128", "");
} }
if sess.target.arch.starts_with("wasm32") || sess.target.arch.starts_with("wasm64") {
// LLVM 20 updates the wasm(32|64) layout to correctly align 128 bit integers to 128 bit.
// See https://github.com/llvm/llvm-project/pull/119204
target_data_layout = target_data_layout.replace("-i128:128", "");
}
} }
// Ensure the data-layout values hardcoded remain the defaults. // Ensure the data-layout values hardcoded remain the defaults.

View file

@ -32,7 +32,8 @@ pub(crate) fn target() -> Target {
std: Some(true), std: Some(true),
}, },
pointer_width: 32, pointer_width: 32,
data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-S128-ni:1:10:20".into(), data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-f128:64-n32:64-S128-ni:1:10:20"
.into(),
arch: "wasm32".into(), arch: "wasm32".into(),
options: opts, options: opts,
} }

View file

@ -37,7 +37,7 @@ pub(crate) fn target() -> Target {
std: Some(true), std: Some(true),
}, },
pointer_width: 32, pointer_width: 32,
data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20".into(), data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
arch: "wasm32".into(), arch: "wasm32".into(),
options, options,
} }

View file

@ -55,7 +55,7 @@ pub(crate) fn target() -> Target {
std: Some(true), std: Some(true),
}, },
pointer_width: 32, pointer_width: 32,
data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20".into(), data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
arch: "wasm32".into(), arch: "wasm32".into(),
options, options,
} }

View file

@ -66,7 +66,7 @@ pub(crate) fn target() -> Target {
std: Some(true), std: Some(true),
}, },
pointer_width: 32, pointer_width: 32,
data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20".into(), data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
arch: "wasm32".into(), arch: "wasm32".into(),
options, options,
} }

View file

@ -66,7 +66,7 @@ pub(crate) fn target() -> Target {
std: Some(true), std: Some(true),
}, },
pointer_width: 32, pointer_width: 32,
data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20".into(), data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
arch: "wasm32".into(), arch: "wasm32".into(),
options, options,
} }

View file

@ -44,7 +44,7 @@ pub(crate) fn target() -> Target {
std: Some(false), std: Some(false),
}, },
pointer_width: 32, pointer_width: 32,
data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20".into(), data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
arch: "wasm32".into(), arch: "wasm32".into(),
options, options,
} }

View file

@ -40,7 +40,7 @@ pub(crate) fn target() -> Target {
std: None, // ? std: None, // ?
}, },
pointer_width: 64, pointer_width: 64,
data_layout: "e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20".into(), data_layout: "e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
arch: "wasm64".into(), arch: "wasm64".into(),
options, options,
} }