Skip to content

Commit e071fd0

Browse files
committed
Change context to LLVM < 21.2
1 parent 1ff611f commit e071fd0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_codegen_llvm/src/context.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ pub(crate) unsafe fn create_module<'ll>(
213213
target_data_layout = target_data_layout.replace("p8:128:128:128:48", "p8:128:128")
214214
}
215215
}
216+
if llvm_version < (21, 2, 0) {
217+
if sess.target.arch == "avr" {
218+
// LLVM 21.2 updated the default layout on avr: https://github.com/llvm/llvm-project/pull/152028
219+
target_data_layout = target_data_layout.replace("n8-n16:8", "n8")
220+
}
221+
}
216222

217223
// Ensure the data-layout values hardcoded remain the defaults.
218224
{

0 commit comments

Comments
 (0)