about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/context.rs
diff options
context:
space:
mode:
authorOli Scherer <github35764891676564198441@oli-obk.de>2025-08-15 05:37:38 +0000
committerGitHub <noreply@github.com>2025-08-15 05:37:38 +0000
commitfb8ac986b178ed977c3334ad27198b787e1e6140 (patch)
tree0357a02c333b17b444b55ee9b311aa62eee0b0b7 /compiler/rustc_codegen_llvm/src/context.rs
parentfa41e9b47348171862773b70eaca70a0ff240963 (diff)
parent1c55a277732442297fb8fe1c92ea0b3c59c5825b (diff)
downloadrust-fb8ac986b178ed977c3334ad27198b787e1e6140.tar.gz
rust-fb8ac986b178ed977c3334ad27198b787e1e6140.zip
Merge pull request #4527 from rust-lang/rustup-2025-08-15
Automatic Rustup
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.
     {