about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/context.rs
diff options
context:
space:
mode:
authorTom Vijlbrief <tvijlbrief@gmail.com>2025-08-11 11:19:47 +0200
committerTom Vijlbrief <tvijlbrief@gmail.com>2025-08-12 08:33:27 +0200
commit2563e4a7ffe47e93c69283c14e6d660b08834cf1 (patch)
tree63f50ac89a5f81dea5401c8e9e048463e225951e /compiler/rustc_codegen_llvm/src/context.rs
parent7f7b8ef27d86c865a7ab20c7c42f50811c6a914d (diff)
downloadrust-2563e4a7ffe47e93c69283c14e6d660b08834cf1.tar.gz
rust-2563e4a7ffe47e93c69283c14e6d660b08834cf1.zip
[AVR] Changed data_layout
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/context.rs')
-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 ee77774c688..27ae729a531 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -213,6 +213,12 @@ pub(crate) unsafe fn create_module<'ll>(
             target_data_layout = target_data_layout.replace("p8:128:128:128:48", "p8:128:128")
         }
     }
+    if llvm_version < (22, 0, 0) {
+        if sess.target.arch == "avr" {
+            // LLVM 22.0 updated the default layout on avr: https://github.com/llvm/llvm-project/pull/153010
+            target_data_layout = target_data_layout.replace("n8:16", "n8")
+        }
+    }
 
     // Ensure the data-layout values hardcoded remain the defaults.
     {