about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-21 13:13:03 +0000
committerbors <bors@rust-lang.org>2024-01-21 13:13:03 +0000
commit70e720bc685e21bbae276445fedf7d89613ecb0d (patch)
treebea46b5cbfb4f8baa9e4b0e34be77eb9600be0da /compiler/rustc_codegen_llvm/src
parent0c8e1e6f444d28742aff75f8789df69007ca589a (diff)
parent7092c660077d185df375eaf07d649be2b49018d0 (diff)
downloadrust-70e720bc685e21bbae276445fedf7d89613ecb0d.tar.gz
rust-70e720bc685e21bbae276445fedf7d89613ecb0d.zip
Auto merge of #3270 - rust-lang:rustup-2024-01-21, r=RalfJung
Automatic Rustup
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 1d1b6e6148d..f3b2caf9b80 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -145,6 +145,14 @@ pub unsafe fn create_module<'ll>(
                 .replace("-Fi64", "");
         }
     }
+    if llvm_version < (18, 0, 0) {
+        if sess.target.arch == "x86" || sess.target.arch == "x86_64" {
+            // LLVM 18 adjusts i128 to be 128-bit aligned on x86 variants.
+            // Earlier LLVMs leave this as default alignment, so remove it.
+            // See https://reviews.llvm.org/D86310
+            target_data_layout = target_data_layout.replace("-i128:128", "");
+        }
+    }
 
     // Ensure the data-layout values hardcoded remain the defaults.
     if sess.target.is_builtin {