This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +13
-7
lines changed
rustc_target/src/spec/targets Expand file tree Collapse file tree 8 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,11 @@ pub(crate) unsafe fn create_module<'ll>(
164164 // See https://github.com/llvm/llvm-project/pull/118004
165165 target_data_layout = target_data_layout. replace ( "-i128:128" , "" ) ;
166166 }
167+ if sess. target . arch . starts_with ( "wasm32" ) || sess. target . arch . starts_with ( "wasm64" ) {
168+ // LLVM 20 updates the wasm(32|64) layout to correctly align 128 bit integers to 128 bit.
169+ // See https://github.com/llvm/llvm-project/pull/119204
170+ target_data_layout = target_data_layout. replace ( "-i128:128" , "" ) ;
171+ }
167172 }
168173
169174 // Ensure the data-layout values hardcoded remain the defaults.
Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ pub(crate) fn target() -> Target {
3232 std : Some ( true ) ,
3333 } ,
3434 pointer_width : 32 ,
35- data_layout : "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-S128-ni:1:10:20" . into ( ) ,
35+ data_layout : "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-f128:64-n32:64-S128-ni:1:10:20"
36+ . into ( ) ,
3637 arch : "wasm32" . into ( ) ,
3738 options : opts,
3839 }
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ pub(crate) fn target() -> Target {
3737 std : Some ( true ) ,
3838 } ,
3939 pointer_width : 32 ,
40- data_layout : "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20" . into ( ) ,
40+ data_layout : "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128- n32:64-S128-ni:1:10:20" . into ( ) ,
4141 arch : "wasm32" . into ( ) ,
4242 options,
4343 }
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ pub(crate) fn target() -> Target {
5555 std : Some ( true ) ,
5656 } ,
5757 pointer_width : 32 ,
58- data_layout : "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20" . into ( ) ,
58+ data_layout : "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128- n32:64-S128-ni:1:10:20" . into ( ) ,
5959 arch : "wasm32" . into ( ) ,
6060 options,
6161 }
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ pub(crate) fn target() -> Target {
6666 std : Some ( true ) ,
6767 } ,
6868 pointer_width : 32 ,
69- data_layout : "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20" . into ( ) ,
69+ data_layout : "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128- n32:64-S128-ni:1:10:20" . into ( ) ,
7070 arch : "wasm32" . into ( ) ,
7171 options,
7272 }
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ pub(crate) fn target() -> Target {
6666 std : Some ( true ) ,
6767 } ,
6868 pointer_width : 32 ,
69- data_layout : "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20" . into ( ) ,
69+ data_layout : "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128- n32:64-S128-ni:1:10:20" . into ( ) ,
7070 arch : "wasm32" . into ( ) ,
7171 options,
7272 }
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ pub(crate) fn target() -> Target {
4444 std : Some ( false ) ,
4545 } ,
4646 pointer_width : 32 ,
47- data_layout : "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20" . into ( ) ,
47+ data_layout : "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128- n32:64-S128-ni:1:10:20" . into ( ) ,
4848 arch : "wasm32" . into ( ) ,
4949 options,
5050 }
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ pub(crate) fn target() -> Target {
4040 std : None , // ?
4141 } ,
4242 pointer_width : 64 ,
43- data_layout : "e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20" . into ( ) ,
43+ data_layout : "e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-i128:128- n32:64-S128-ni:1:10:20" . into ( ) ,
4444 arch : "wasm64" . into ( ) ,
4545 options,
4646 }
You can’t perform that action at this time.
0 commit comments