File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
rustc_target/src/spec/targets Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff 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 < ( 22 , 0 , 0 ) {
217+ if sess. target . arch == "avr" {
218+ // LLVM 22.0 updated the default layout on avr: https://github.com/llvm/llvm-project/pull/153010
219+ target_data_layout = target_data_layout. replace ( "n8:16" , "n8" )
220+ }
221+ }
216222
217223 // Ensure the data-layout values hardcoded remain the defaults.
218224 {
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ pub(crate) fn target() -> Target {
99 host_tools : None ,
1010 std : None ,
1111 } ,
12- data_layout : "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8" . into ( ) ,
12+ data_layout : "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8:16 -a:8" . into ( ) ,
1313 llvm_target : "avr-unknown-unknown" . into ( ) ,
1414 pointer_width : 16 ,
1515 options : TargetOptions {
You can’t perform that action at this time.
0 commit comments