about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-07-28 22:26:14 +0200
committerNikita Popov <nikita.ppv@gmail.com>2021-08-16 18:28:18 +0200
commit6eaf227ce15c37dedb07696209dab03629990204 (patch)
treea9373c3b6b3d605f1b49591a439bc693b05d3f82 /compiler/rustc_codegen_llvm/src
parent335f003b0241ec544bd337afba91c7d447b05dbe (diff)
downloadrust-6eaf227ce15c37dedb07696209dab03629990204.tar.gz
rust-6eaf227ce15c37dedb07696209dab03629990204.zip
Update wasm data layout
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/context.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs
index 5d56c93f835..e204606443a 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -132,6 +132,14 @@ pub unsafe fn create_module(
     if llvm_util::get_version() < (12, 0, 0) && sess.target.arch == "powerpc64" {
         target_data_layout = strip_powerpc64_vectors(target_data_layout);
     }
+    if llvm_util::get_version() < (13, 0, 0) {
+        if sess.target.arch == "wasm32" {
+            target_data_layout = "e-m:e-p:32:32-i64:64-n32:64-S128".to_string();
+        }
+        if sess.target.arch == "wasm64" {
+            target_data_layout = "e-m:e-p:64:64-i64:64-n32:64-S128".to_string();
+        }
+    }
 
     // Ensure the data-layout values hardcoded remain the defaults.
     if sess.target.is_builtin {