about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-12-11 20:00:21 +0100
committerGitHub <noreply@github.com>2024-12-11 20:00:21 +0100
commiteefefbea2fa4df7cc4779f272b8aa7eaaf8e200d (patch)
treed6c00bdab0b1a6443bb1bfb42c1bc44660c9b696 /compiler/rustc_codegen_llvm
parent13c13ee4ecd7b5c84ae0959f530787bef418e941 (diff)
parent48b883287adbe5c913e473e361c07f7c61c6bc5a (diff)
downloadrust-eefefbea2fa4df7cc4779f272b8aa7eaaf8e200d.tar.gz
rust-eefefbea2fa4df7cc4779f272b8aa7eaaf8e200d.zip
Rollup merge of #134165 - durin42:wasm-target-string, r=jieyouxu
wasm(32|64): update alignment string

See llvm/llvm-project@c5ab70c508457eaece5d7ff4ab79a2f90bc67f06

`@rustbot` label: +llvm-main
Diffstat (limited to 'compiler/rustc_codegen_llvm')
-rw-r--r--compiler/rustc_codegen_llvm/src/context.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs
index e0506c0c5fd..c602d99ff9d 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -164,6 +164,11 @@ pub(crate) unsafe fn create_module<'ll>(
             // See https://github.com/llvm/llvm-project/pull/118004
             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.