From 2563e4a7ffe47e93c69283c14e6d660b08834cf1 Mon Sep 17 00:00:00 2001 From: Tom Vijlbrief Date: Mon, 11 Aug 2025 11:19:47 +0200 Subject: [AVR] Changed data_layout --- compiler/rustc_codegen_llvm/src/context.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'compiler/rustc_codegen_llvm/src/context.rs') 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. { -- cgit 1.4.1-3-g733a5