From a41f07b72c0f12fccd3f567bc40ed1dacc5a8ba7 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 3 Jul 2026 14:28:32 +0200 Subject: [PATCH 1/8] Update to LLVM 23 --- .gitmodules | 4 ++-- src/llvm-project | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 9f9d573668245..0c8629ed38758 100644 --- a/.gitmodules +++ b/.gitmodules @@ -24,8 +24,8 @@ shallow = true [submodule "src/llvm-project"] path = src/llvm-project - url = https://github.com/rust-lang/llvm-project.git - branch = rustc/22.1-2026-05-19 + url = https://github.com/nikic/llvm-project.git + branch = rust-llvm-23 shallow = true [submodule "src/doc/embedded-book"] path = src/doc/embedded-book diff --git a/src/llvm-project b/src/llvm-project index 52ed14fcd56af..b73e9821796f4 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit 52ed14fcd56afc30f9cccd8ca8ce237c2eef7e04 +Subproject commit b73e9821796f4a6b78098a4cc794aa6ddb9ae018 From b18eddb85319d2977730fd33e27f71948f73146d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 3 Jul 2026 15:29:32 +0200 Subject: [PATCH 2/8] Update cov-map tests for LLVM 23 There is a minor change in sorted order due to: https://github.com/llvm/llvm-project/commit/593103465326850f23bc9a6078ae7fb01065d46e --- tests/coverage/async.cov-map | 8 ++++---- tests/coverage/async.coverage | 2 +- tests/coverage/async.rs | 2 +- tests/coverage/coroutine.cov-map | 16 ++++++++-------- tests/coverage/coroutine.coverage | 1 + tests/coverage/coroutine.rs | 1 + tests/coverage/yield.cov-map | 28 ++++++++++++++-------------- tests/coverage/yield.coverage | 1 + tests/coverage/yield.rs | 1 + 9 files changed, 32 insertions(+), 28 deletions(-) diff --git a/tests/coverage/async.cov-map b/tests/coverage/async.cov-map index d75c4b5981a05..b4304a43d64e6 100644 --- a/tests/coverage/async.cov-map +++ b/tests/coverage/async.cov-map @@ -166,7 +166,7 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: async::i::{closure#0} -Raw bytes (75): 0x[01, 01, 03, 05, 09, 11, 15, 0d, 11, 0d, 01, 2c, 13, 00, 14, 01, 04, 0b, 00, 0c, 09, 01, 09, 00, 0a, 01, 00, 0e, 00, 0f, 01, 00, 0e, 00, 18, 05, 00, 1c, 00, 21, 09, 00, 27, 00, 30, 15, 01, 09, 00, 0a, 02, 00, 0e, 00, 17, 11, 00, 1b, 00, 20, 15, 00, 24, 00, 26, 06, 01, 0e, 00, 10, 0b, 02, 01, 00, 02] +Raw bytes (75): 0x[01, 01, 03, 05, 09, 11, 15, 0d, 11, 0d, 01, 2c, 13, 00, 14, 01, 04, 0b, 00, 0c, 09, 01, 09, 00, 0a, 01, 00, 0e, 00, 18, 01, 00, 0e, 00, 0f, 05, 00, 1c, 00, 21, 09, 00, 27, 00, 30, 15, 01, 09, 00, 0a, 02, 00, 0e, 00, 17, 11, 00, 1b, 00, 20, 15, 00, 24, 00, 26, 06, 01, 0e, 00, 10, 0b, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async.rs Number of expressions: 3 @@ -177,8 +177,8 @@ Number of file 0 mappings: 13 - Code(Counter(0)) at (prev + 44, 19) to (start + 0, 20) - Code(Counter(0)) at (prev + 4, 11) to (start + 0, 12) - Code(Counter(2)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 15) - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 24) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 15) - Code(Counter(1)) at (prev + 0, 28) to (start + 0, 33) - Code(Counter(2)) at (prev + 0, 39) to (start + 0, 48) - Code(Counter(5)) at (prev + 1, 9) to (start + 0, 10) @@ -193,7 +193,7 @@ Number of file 0 mappings: 13 Highest counter ID seen: c5 Function name: async::j -Raw bytes (65): 0x[01, 01, 03, 01, 05, 01, 0b, 05, 09, 0b, 01, 37, 01, 00, 0c, 01, 0b, 0b, 00, 0c, 05, 01, 09, 00, 0a, 01, 00, 0e, 00, 0f, 01, 00, 0e, 00, 1b, 05, 00, 1f, 00, 27, 09, 01, 09, 00, 0a, 02, 00, 0e, 00, 1a, 09, 00, 1e, 00, 20, 06, 01, 0e, 00, 10, 01, 02, 01, 00, 02] +Raw bytes (65): 0x[01, 01, 03, 01, 05, 01, 0b, 05, 09, 0b, 01, 37, 01, 00, 0c, 01, 0b, 0b, 00, 0c, 05, 01, 09, 00, 0a, 01, 00, 0e, 00, 1b, 01, 00, 0e, 00, 0f, 05, 00, 1f, 00, 27, 09, 01, 09, 00, 0a, 02, 00, 0e, 00, 1a, 09, 00, 1e, 00, 20, 06, 01, 0e, 00, 10, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async.rs Number of expressions: 3 @@ -204,8 +204,8 @@ Number of file 0 mappings: 11 - Code(Counter(0)) at (prev + 55, 1) to (start + 0, 12) - Code(Counter(0)) at (prev + 11, 11) to (start + 0, 12) - Code(Counter(1)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 15) - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 27) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 15) - Code(Counter(1)) at (prev + 0, 31) to (start + 0, 39) - Code(Counter(2)) at (prev + 1, 9) to (start + 0, 10) - Code(Expression(0, Sub)) at (prev + 0, 14) to (start + 0, 26) diff --git a/tests/coverage/async.coverage b/tests/coverage/async.coverage index 9409e6b1deb85..fe1a353b5f1a1 100644 --- a/tests/coverage/async.coverage +++ b/tests/coverage/async.coverage @@ -4,7 +4,7 @@ LL| |#![rustfmt::skip] LL| |//@ edition: 2018 LL| |//@ compile-flags: -Copt-level=1 - LL| | + LL| |//@ min-llvm-version: 23 LL| |//@ aux-build: executor.rs LL| |extern crate executor; LL| | diff --git a/tests/coverage/async.rs b/tests/coverage/async.rs index 777ad7ce7c0c3..d8f608df81535 100644 --- a/tests/coverage/async.rs +++ b/tests/coverage/async.rs @@ -4,7 +4,7 @@ #![rustfmt::skip] //@ edition: 2018 //@ compile-flags: -Copt-level=1 - +//@ min-llvm-version: 23 //@ aux-build: executor.rs extern crate executor; diff --git a/tests/coverage/coroutine.cov-map b/tests/coverage/coroutine.cov-map index daa42915a4af5..9599af9f0ab2c 100644 --- a/tests/coverage/coroutine.cov-map +++ b/tests/coverage/coroutine.cov-map @@ -1,11 +1,11 @@ Function name: coroutine::get_u32 -Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 0b, 01, 00, 2d, 01, 01, 08, 00, 0b, 05, 01, 09, 00, 0e, 02, 02, 09, 00, 28, 01, 02, 01, 00, 02] +Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 0c, 01, 00, 2d, 01, 01, 08, 00, 0b, 05, 01, 09, 00, 0e, 02, 02, 09, 00, 28, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/coroutine.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 5 -- Code(Counter(0)) at (prev + 11, 1) to (start + 0, 45) +- Code(Counter(0)) at (prev + 12, 1) to (start + 0, 45) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 11) - Code(Counter(1)) at (prev + 1, 9) to (start + 0, 14) - Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 40) @@ -14,14 +14,14 @@ Number of file 0 mappings: 5 Highest counter ID seen: c1 Function name: coroutine::main -Raw bytes (93): 0x[01, 01, 02, 01, 05, 05, 09, 11, 01, 13, 01, 00, 0a, 01, 01, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 01, 09, 00, 16, 01, 06, 0b, 00, 13, 01, 00, 14, 00, 22, 01, 00, 24, 00, 2a, 01, 00, 2b, 00, 2d, 05, 01, 2b, 00, 2d, 02, 01, 0e, 00, 14, 05, 02, 0b, 00, 13, 05, 00, 0b, 00, 2e, 05, 00, 14, 00, 22, 0d, 01, 22, 00, 27, 09, 00, 2c, 00, 2e, 06, 01, 0e, 00, 14, 09, 02, 01, 00, 02] +Raw bytes (93): 0x[01, 01, 02, 01, 05, 05, 09, 11, 01, 14, 01, 00, 0a, 01, 01, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 01, 09, 00, 16, 01, 06, 0b, 00, 13, 01, 00, 14, 00, 22, 01, 00, 24, 00, 2a, 01, 00, 2b, 00, 2d, 05, 01, 2b, 00, 2d, 02, 01, 0e, 00, 14, 05, 02, 0b, 00, 2e, 05, 00, 0b, 00, 13, 05, 00, 14, 00, 22, 0d, 01, 22, 00, 27, 09, 00, 2c, 00, 2e, 06, 01, 0e, 00, 14, 09, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/coroutine.rs Number of expressions: 2 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) - expression 1 operands: lhs = Counter(1), rhs = Counter(2) Number of file 0 mappings: 17 -- Code(Counter(0)) at (prev + 19, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 20, 1) to (start + 0, 10) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) - Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) @@ -32,8 +32,8 @@ Number of file 0 mappings: 17 - Code(Counter(1)) at (prev + 1, 43) to (start + 0, 45) - Code(Expression(0, Sub)) at (prev + 1, 14) to (start + 0, 20) = (c0 - c1) -- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 19) -- Code(Counter(1)) at (prev + 0, 11) to (start + 0, 46) +- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 46) +- Code(Counter(1)) at (prev + 0, 11) to (start + 0, 19) - Code(Counter(1)) at (prev + 0, 20) to (start + 0, 34) - Code(Counter(3)) at (prev + 1, 34) to (start + 0, 39) - Code(Counter(2)) at (prev + 0, 44) to (start + 0, 46) @@ -43,12 +43,12 @@ Number of file 0 mappings: 17 Highest counter ID seen: c3 Function name: coroutine::main::{closure#0} -Raw bytes (24): 0x[01, 01, 00, 04, 01, 16, 08, 00, 09, 01, 01, 09, 00, 1f, 05, 01, 10, 00, 15, 05, 01, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 17, 08, 00, 09, 01, 01, 09, 00, 1f, 05, 01, 10, 00, 15, 05, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/coroutine.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 22, 8) to (start + 0, 9) +- Code(Counter(0)) at (prev + 23, 8) to (start + 0, 9) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 31) - Code(Counter(1)) at (prev + 1, 16) to (start + 0, 21) - Code(Counter(1)) at (prev + 1, 5) to (start + 0, 6) diff --git a/tests/coverage/coroutine.coverage b/tests/coverage/coroutine.coverage index 611470c577388..02fc91bcf5863 100644 --- a/tests/coverage/coroutine.coverage +++ b/tests/coverage/coroutine.coverage @@ -1,3 +1,4 @@ + LL| |//@ min-llvm-version: 23 LL| |#![feature(coroutines, coroutine_trait, stmt_expr_attributes)] LL| | LL| |use std::ops::{Coroutine, CoroutineState}; diff --git a/tests/coverage/coroutine.rs b/tests/coverage/coroutine.rs index bd149764b3737..9a11abd934e4a 100644 --- a/tests/coverage/coroutine.rs +++ b/tests/coverage/coroutine.rs @@ -1,3 +1,4 @@ +//@ min-llvm-version: 23 #![feature(coroutines, coroutine_trait, stmt_expr_attributes)] use std::ops::{Coroutine, CoroutineState}; diff --git a/tests/coverage/yield.cov-map b/tests/coverage/yield.cov-map index 87d0a0472615f..8c1da30c08b6c 100644 --- a/tests/coverage/yield.cov-map +++ b/tests/coverage/yield.cov-map @@ -1,5 +1,5 @@ Function name: yield::main -Raw bytes (139): 0x[01, 01, 05, 01, 05, 05, 09, 09, 11, 11, 15, 11, 15, 19, 01, 07, 01, 00, 0a, 01, 01, 09, 00, 16, 01, 06, 0b, 00, 13, 01, 00, 0b, 00, 2e, 01, 00, 14, 00, 22, 05, 01, 27, 00, 29, 02, 01, 0e, 00, 14, 05, 02, 0b, 00, 13, 05, 00, 0b, 00, 2e, 05, 00, 14, 00, 22, 0d, 01, 22, 00, 27, 09, 00, 2c, 00, 2e, 06, 01, 0e, 00, 14, 09, 03, 09, 00, 16, 09, 08, 0b, 00, 13, 09, 00, 0b, 00, 2e, 09, 00, 14, 00, 22, 11, 01, 27, 00, 29, 0a, 01, 0e, 00, 14, 11, 02, 0b, 00, 13, 11, 00, 0b, 00, 2e, 11, 00, 14, 00, 22, 12, 01, 27, 00, 29, 15, 01, 0e, 00, 14, 12, 02, 01, 00, 02] +Raw bytes (139): 0x[01, 01, 05, 01, 05, 05, 09, 09, 11, 11, 15, 11, 15, 19, 01, 08, 01, 00, 0a, 01, 01, 09, 00, 16, 01, 06, 0b, 00, 2e, 01, 00, 0b, 00, 13, 01, 00, 14, 00, 22, 05, 01, 27, 00, 29, 02, 01, 0e, 00, 14, 05, 02, 0b, 00, 2e, 05, 00, 0b, 00, 13, 05, 00, 14, 00, 22, 0d, 01, 22, 00, 27, 09, 00, 2c, 00, 2e, 06, 01, 0e, 00, 14, 09, 03, 09, 00, 16, 09, 08, 0b, 00, 2e, 09, 00, 0b, 00, 13, 09, 00, 14, 00, 22, 11, 01, 27, 00, 29, 0a, 01, 0e, 00, 14, 11, 02, 0b, 00, 2e, 11, 00, 0b, 00, 13, 11, 00, 14, 00, 22, 12, 01, 27, 00, 29, 15, 01, 0e, 00, 14, 12, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/yield.rs Number of expressions: 5 @@ -9,30 +9,30 @@ Number of expressions: 5 - expression 3 operands: lhs = Counter(4), rhs = Counter(5) - expression 4 operands: lhs = Counter(4), rhs = Counter(5) Number of file 0 mappings: 25 -- Code(Counter(0)) at (prev + 7, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 10) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 6, 11) to (start + 0, 19) -- Code(Counter(0)) at (prev + 0, 11) to (start + 0, 46) +- Code(Counter(0)) at (prev + 6, 11) to (start + 0, 46) +- Code(Counter(0)) at (prev + 0, 11) to (start + 0, 19) - Code(Counter(0)) at (prev + 0, 20) to (start + 0, 34) - Code(Counter(1)) at (prev + 1, 39) to (start + 0, 41) - Code(Expression(0, Sub)) at (prev + 1, 14) to (start + 0, 20) = (c0 - c1) -- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 19) -- Code(Counter(1)) at (prev + 0, 11) to (start + 0, 46) +- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 46) +- Code(Counter(1)) at (prev + 0, 11) to (start + 0, 19) - Code(Counter(1)) at (prev + 0, 20) to (start + 0, 34) - Code(Counter(3)) at (prev + 1, 34) to (start + 0, 39) - Code(Counter(2)) at (prev + 0, 44) to (start + 0, 46) - Code(Expression(1, Sub)) at (prev + 1, 14) to (start + 0, 20) = (c1 - c2) - Code(Counter(2)) at (prev + 3, 9) to (start + 0, 22) -- Code(Counter(2)) at (prev + 8, 11) to (start + 0, 19) -- Code(Counter(2)) at (prev + 0, 11) to (start + 0, 46) +- Code(Counter(2)) at (prev + 8, 11) to (start + 0, 46) +- Code(Counter(2)) at (prev + 0, 11) to (start + 0, 19) - Code(Counter(2)) at (prev + 0, 20) to (start + 0, 34) - Code(Counter(4)) at (prev + 1, 39) to (start + 0, 41) - Code(Expression(2, Sub)) at (prev + 1, 14) to (start + 0, 20) = (c2 - c4) -- Code(Counter(4)) at (prev + 2, 11) to (start + 0, 19) -- Code(Counter(4)) at (prev + 0, 11) to (start + 0, 46) +- Code(Counter(4)) at (prev + 2, 11) to (start + 0, 46) +- Code(Counter(4)) at (prev + 0, 11) to (start + 0, 19) - Code(Counter(4)) at (prev + 0, 20) to (start + 0, 34) - Code(Expression(4, Sub)) at (prev + 1, 39) to (start + 0, 41) = (c4 - c5) @@ -42,24 +42,24 @@ Number of file 0 mappings: 25 Highest counter ID seen: c5 Function name: yield::main::{closure#0} -Raw bytes (24): 0x[01, 01, 00, 04, 01, 09, 08, 00, 09, 01, 01, 09, 00, 10, 05, 01, 10, 00, 15, 05, 01, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 0a, 08, 00, 09, 01, 01, 09, 00, 10, 05, 01, 10, 00, 15, 05, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/yield.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 9, 8) to (start + 0, 9) +- Code(Counter(0)) at (prev + 10, 8) to (start + 0, 9) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) - Code(Counter(1)) at (prev + 1, 16) to (start + 0, 21) - Code(Counter(1)) at (prev + 1, 5) to (start + 0, 6) Highest counter ID seen: c1 Function name: yield::main::{closure#1} -Raw bytes (34): 0x[01, 01, 00, 06, 01, 18, 08, 00, 09, 01, 01, 09, 00, 10, 05, 01, 09, 00, 10, 09, 01, 09, 00, 10, 0d, 01, 10, 00, 15, 0d, 01, 05, 00, 06] +Raw bytes (34): 0x[01, 01, 00, 06, 01, 19, 08, 00, 09, 01, 01, 09, 00, 10, 05, 01, 09, 00, 10, 09, 01, 09, 00, 10, 0d, 01, 10, 00, 15, 0d, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/yield.rs Number of expressions: 0 Number of file 0 mappings: 6 -- Code(Counter(0)) at (prev + 24, 8) to (start + 0, 9) +- Code(Counter(0)) at (prev + 25, 8) to (start + 0, 9) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) - Code(Counter(1)) at (prev + 1, 9) to (start + 0, 16) - Code(Counter(2)) at (prev + 1, 9) to (start + 0, 16) diff --git a/tests/coverage/yield.coverage b/tests/coverage/yield.coverage index 2c133cbec5495..2fea2d94dae4b 100644 --- a/tests/coverage/yield.coverage +++ b/tests/coverage/yield.coverage @@ -1,3 +1,4 @@ + LL| |//@ min-llvm-version: 23 LL| |#![feature(coroutines, coroutine_trait, stmt_expr_attributes)] LL| |#![allow(unused_assignments)] LL| | diff --git a/tests/coverage/yield.rs b/tests/coverage/yield.rs index e02e3d3561243..da868e39f5893 100644 --- a/tests/coverage/yield.rs +++ b/tests/coverage/yield.rs @@ -1,3 +1,4 @@ +//@ min-llvm-version: 23 #![feature(coroutines, coroutine_trait, stmt_expr_attributes)] #![allow(unused_assignments)] From 42504c0d703c734bc68bb74285ed22957921e979 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 13 Jul 2026 15:09:07 +0200 Subject: [PATCH 3/8] Update host toolchain --- src/ci/docker/scripts/build-clang.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/docker/scripts/build-clang.sh b/src/ci/docker/scripts/build-clang.sh index b3b1dc47e2ef7..de61186f1f636 100755 --- a/src/ci/docker/scripts/build-clang.sh +++ b/src/ci/docker/scripts/build-clang.sh @@ -5,7 +5,7 @@ set -ex source shared.sh # Try to keep the LLVM version here in sync with src/ci/scripts/install-clang.sh -LLVM=llvmorg-22.1.0-rc2 +LLVM=f60650c772485640b57520e91cec9779cc7f27dc mkdir llvm-project cd llvm-project From ff91d427e34faf05f21dc0b373241d90fa5dcd30 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 16 Jul 2026 10:10:59 +0200 Subject: [PATCH 4/8] Set LLVM_VERSIONED_DYLIB_NAME_ON_DARWIN=OFF We probably want to change this to align with Linux, but for now keep the old behavior. --- src/bootstrap/src/core/build_steps/llvm.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index 0c7806342a1e6..fc4c4b8707122 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -407,6 +407,8 @@ impl Step for Llvm { // equally well everywhere. if builder.llvm_link_shared() { cfg.define("LLVM_LINK_LLVM_DYLIB", "ON"); + // Keep the pre-LLVM23 behavior for now. + cfg.define("LLVM_VERSIONED_DYLIB_NAME_ON_DARWIN", "OFF"); } if (target.starts_with("csky") From 56abcdcd0606edd558fd419543352723e9bf3fb4 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 16 Jul 2026 10:18:14 +0200 Subject: [PATCH 5/8] Distribute llvm-project/libc It's a dependency of LLVM now. --- src/bootstrap/src/core/build_steps/dist.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index b74dd7dc3b987..fdc22577747da 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -1070,6 +1070,7 @@ fn copy_src_dirs( static LLVM_PROJECTS: &[&str] = &[ "llvm-project/clang", + "llvm-project/libc", "llvm-project/libunwind", "llvm-project/lld", "llvm-project/lldb", From d5e528446b7e74e7e5a393d73ae9b0bdab3b9e75 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Tue, 7 Jul 2026 16:42:27 +0000 Subject: [PATCH 6/8] x86_64-win: Return f128 on the stack, matching LLVM We can start matching the codegen introduced by LLVM at [1]. This alone isn't enough to make f128 functional on the platform because libcalls use the LLVM ABI. Current behavior originally introduced in RUST-128388. [1]: https://github.com/llvm/llvm-project/commit/aa47e59245e24edb6d0c7d5f91b3a1c5a7bb35f1 --- compiler/rustc_target/src/callconv/x86_win64.rs | 8 ++------ tests/assembly-llvm/x86_64-windows-float-abi.rs | 13 ++++--------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/compiler/rustc_target/src/callconv/x86_win64.rs b/compiler/rustc_target/src/callconv/x86_win64.rs index 4aaf34e56ce4b..8e6f50bc9e5c4 100644 --- a/compiler/rustc_target/src/callconv/x86_win64.rs +++ b/compiler/rustc_target/src/callconv/x86_win64.rs @@ -1,4 +1,4 @@ -use rustc_abi::{BackendRepr, Float, Integer, Primitive, Size, TyAbiInterface}; +use rustc_abi::{BackendRepr, Integer, Primitive, Size, TyAbiInterface}; use crate::callconv::{ArgAbi, FnAbi, Reg}; use crate::spec::{HasTargetSpec, RustcAbi}; @@ -35,11 +35,7 @@ where // FIXME(#134288): This may change for the `-msvc` targets in the future. a.cast_to(Reg::opaque_vector(Size::from_bits(128))); } - } else if a.layout.size.bytes() > 8 - && !matches!(scalar.primitive(), Primitive::Float(Float::F128)) - { - // Match what LLVM does for `f128` so that `compiler-builtins` builtins match up - // with what LLVM expects. + } else if a.layout.size.bytes() > 8 { a.make_indirect(); } else { a.extend_integer_width_to(32); diff --git a/tests/assembly-llvm/x86_64-windows-float-abi.rs b/tests/assembly-llvm/x86_64-windows-float-abi.rs index b6ab9995fdb3e..3b9d85b279ca7 100644 --- a/tests/assembly-llvm/x86_64-windows-float-abi.rs +++ b/tests/assembly-llvm/x86_64-windows-float-abi.rs @@ -3,9 +3,6 @@ //@ compile-flags: --target x86_64-pc-windows-msvc //@ needs-llvm-components: x86 //@ add-minicore -//@ revisions: LLVM22 LLVM23 -//@ [LLVM22] max-llvm-major-version: 22 -//@ [LLVM23] min-llvm-version: 23 #![feature(f16, f128)] #![feature(no_core)] @@ -40,12 +37,10 @@ pub extern "C" fn second_f64(_: f64, x: f64) -> f64 { } // CHECK-LABEL: second_f128 -// LLVM22: movaps (%rdx), %xmm0 -// LLVM22-NEXT: retq -// LLVM23: movq %rcx, %rax -// LLVM23-NEXT: movaps (%r8), %xmm0 -// LLVM23-NEXT: movaps %xmm0, (%rcx) -// LLVM23-NEXT: retq +// CHECK: movq %rcx, %rax +// CHECK-NEXT: movaps (%r8), %xmm0 +// CHECK-NEXT: movaps %xmm0, (%rcx) +// CHECK-NEXT: retq #[no_mangle] pub extern "C" fn second_f128(_: f128, x: f128) -> f128 { x From 3987d125a56385706f787108f4cbb44c95a2e9fd Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Fri, 10 Jul 2026 15:37:45 +0200 Subject: [PATCH 7/8] fix f128 libcall abi in the cranelift backend --- .../rustc_codegen_cranelift/src/abi/mod.rs | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_codegen_cranelift/src/abi/mod.rs b/compiler/rustc_codegen_cranelift/src/abi/mod.rs index 491463865b5db..b6e42ede72dcc 100644 --- a/compiler/rustc_codegen_cranelift/src/abi/mod.rs +++ b/compiler/rustc_codegen_cranelift/src/abi/mod.rs @@ -139,13 +139,19 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> { mut returns: Vec, args: &[Value], ) -> Cow<'_, [Value]> { - // Pass i128 arguments by-ref on Windows. + // On x86_64 Windows f128 is passed and returned indirectly (sret in LLVM terminology). + let indirect_f128 = + self.tcx.sess.target.is_like_windows && self.tcx.sess.target.arch == Arch::X86_64; + + // Pass i128 (and, on x86_64 Windows, f128) arguments by-ref. let (params, args): (Vec<_>, Cow<'_, [_]>) = if self.tcx.sess.target.is_like_windows { let (params, args): (Vec<_>, Vec<_>) = params .into_iter() .zip(args) .map(|(param, &arg)| { - if param.value_type == types::I128 { + if param.value_type == types::I128 + || (indirect_f128 && param.value_type == types::F128) + { let arg_ptr = self.create_stack_slot(16, 16); arg_ptr.store(self, arg, MemFlags::trusted()); (AbiParam::new(self.pointer_type), arg_ptr.get_addr(self)) @@ -161,6 +167,7 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> { }; let ret_single_i128 = returns.len() == 1 && returns[0].value_type == types::I128; + let ret_single_f128 = returns.len() == 1 && returns[0].value_type == types::F128; if ret_single_i128 && self.tcx.sess.target.is_like_windows { // Return i128 using the vector ABI on Windows returns[0].value_type = types::I64X2; @@ -168,8 +175,11 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> { let ret = self.lib_call_unadjusted(name, params, returns, &args)[0]; Cow::Owned(vec![codegen_bitcast(self, types::I128, ret)]) - } else if ret_single_i128 && self.tcx.sess.target.arch == Arch::S390x { - // Return i128 using a return area pointer on s390x. + } else if (ret_single_i128 && self.tcx.sess.target.arch == Arch::S390x) + || (ret_single_f128 && indirect_f128) + { + // Return x86_64 Windows f128 and s390x i128 indirectly (sret in LLVM terminology). + let ret_ty = returns[0].value_type; let mut params = params; let mut args = args.to_vec(); @@ -179,7 +189,7 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> { self.lib_call_unadjusted(name, params, vec![], &args); - Cow::Owned(vec![ret_ptr.load(self, types::I128, MemFlags::trusted())]) + Cow::Owned(vec![ret_ptr.load(self, ret_ty, MemFlags::trusted())]) } else { Cow::Borrowed(self.lib_call_unadjusted(name, params, returns, &args)) } From efcff8edebc3d40f0bae990d4f64695bb9e0b249 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 20 Jul 2026 09:15:29 +0200 Subject: [PATCH 8/8] Disable RISCV on dist-i686-mingw --- src/ci/github-actions/jobs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index a8eebe7599fda..39578f70a04ca 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -742,9 +742,11 @@ auto: - name: dist-i686-mingw env: + # Disable RISCV target because building it OOMs. RUST_CONFIGURE_ARGS: >- --build=i686-pc-windows-gnu --enable-full-tools + --set llvm.targets=AArch64;AMDGPU;ARM;BPF;Hexagon;LoongArch;MSP430;Mips;NVPTX;PowerPC;Sparc;SystemZ;WebAssembly;X86 SCRIPT: python x.py dist bootstrap --include-default-paths DIST_REQUIRE_ALL_TOOLS: 1 CODEGEN_BACKENDS: llvm,cranelift