about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-02-16 08:04:42 +0000
committerGitHub <noreply@github.com>2025-02-16 08:04:42 +0000
commitbe1e087e1485e0a6f7008fa0bebacbb1a23a6458 (patch)
tree042be607aed8e214e257b43911b93b9b142adddc /compiler/rustc_codegen_llvm/src
parent487346680f6d78d29023d511a2ba71f8ff4d8d01 (diff)
parent703154d4f0db2754493c2f5a464d389377dc0dd2 (diff)
downloadrust-be1e087e1485e0a6f7008fa0bebacbb1a23a6458.tar.gz
rust-be1e087e1485e0a6f7008fa0bebacbb1a23a6458.zip
Merge pull request #4195 from RalfJung/rustup
Rustup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/context.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs
index 7fe527a4c07..e7952bc95e7 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -194,6 +194,12 @@ pub(crate) unsafe fn create_module<'ll>(
             target_data_layout = target_data_layout.replace("-i128:128", "");
         }
     }
+    if llvm_version < (21, 0, 0) {
+        if sess.target.arch == "nvptx64" {
+            // LLVM 21 updated the default layout on nvptx: https://github.com/llvm/llvm-project/pull/124961
+            target_data_layout = target_data_layout.replace("e-p6:32:32-i64", "e-i64");
+        }
+    }
 
     // Ensure the data-layout values hardcoded remain the defaults.
     {