Skip to content

Commit 04e580f

Browse files
committed
Merge commit '8332329f83d4ef34479fec67cc21b21246dca6b5' into sync_cg_clif-2025-02-07
1 parent a005ccd commit 04e580f

12 files changed

+97
-71
lines changed

Diff for: Cargo.lock

+30-30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+13-13
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ crate-type = ["dylib"]
88

99
[dependencies]
1010
# These have to be in sync with each other
11-
cranelift-codegen = { version = "0.115.0", default-features = false, features = ["std", "unwind", "all-native-arch"] }
12-
cranelift-frontend = { version = "0.115.0" }
13-
cranelift-module = { version = "0.115.0" }
14-
cranelift-native = { version = "0.115.0" }
15-
cranelift-jit = { version = "0.115.0", optional = true }
16-
cranelift-object = { version = "0.115.0" }
17-
target-lexicon = "0.12.0"
11+
cranelift-codegen = { version = "0.116.0", default-features = false, features = ["std", "unwind", "all-native-arch"] }
12+
cranelift-frontend = { version = "0.116.0" }
13+
cranelift-module = { version = "0.116.0" }
14+
cranelift-native = { version = "0.116.0" }
15+
cranelift-jit = { version = "0.116.0", optional = true }
16+
cranelift-object = { version = "0.116.0" }
17+
target-lexicon = "0.13"
1818
gimli = { version = "0.31", default-features = false, features = ["write"] }
1919
object = { version = "0.36", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }
2020

@@ -24,12 +24,12 @@ smallvec = "1.8.1"
2424

2525
[patch.crates-io]
2626
# Uncomment to use an unreleased version of cranelift
27-
#cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-28.0.0", version = "0.115.0" }
28-
#cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-28.0.0", version = "0.115.0" }
29-
#cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-28.0.0", version = "0.115.0" }
30-
#cranelift-native = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-28.0.0", version = "0.115.0" }
31-
#cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-28.0.0", version = "0.115.0" }
32-
#cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-28.0.0", version = "0.115.0" }
27+
#cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-29.0.0", version = "0.116.0" }
28+
#cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-29.0.0", version = "0.116.0" }
29+
#cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-29.0.0", version = "0.116.0" }
30+
#cranelift-native = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-29.0.0", version = "0.116.0" }
31+
#cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-29.0.0", version = "0.116.0" }
32+
#cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-29.0.0", version = "0.116.0" }
3333

3434
# Uncomment to use local checkout of cranelift
3535
#cranelift-codegen = { path = "../wasmtime/cranelift/codegen" }

Diff for: build_system/prepare.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ fn init_git_repo(repo_dir: &Path) {
186186
spawn_and_wait(git_add_cmd);
187187

188188
let mut git_commit_cmd = git_command(repo_dir, "commit");
189-
git_commit_cmd.arg("-m").arg("Initial commit").arg("-q");
189+
git_commit_cmd.arg("-m").arg("Initial commit").arg("-q").arg("--no-verify");
190190
spawn_and_wait(git_commit_cmd);
191191
}
192192

Diff for: build_system/tests.rs

-8
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,6 @@ impl<'a> TestRunner<'a> {
330330
target_compiler.rustflags.extend(rustflags_from_env("RUSTFLAGS"));
331331
target_compiler.rustdocflags.extend(rustflags_from_env("RUSTDOCFLAGS"));
332332

333-
// FIXME fix `#[linkage = "extern_weak"]` without this
334-
if target_compiler.triple.contains("darwin") {
335-
target_compiler.rustflags.extend([
336-
"-Clink-arg=-undefined".to_owned(),
337-
"-Clink-arg=dynamic_lookup".to_owned(),
338-
]);
339-
}
340-
341333
let jit_supported = use_unstable_features
342334
&& is_native
343335
&& target_compiler.triple.contains("x86_64")

Diff for: example/mini_core_hello_world.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ fn main() {
274274

275275
assert_eq!(((|()| 42u8) as fn(()) -> u8)(()), 42);
276276

277-
#[cfg(not(any(jit, windows)))]
277+
#[cfg(not(any(jit, target_vendor = "apple", windows)))]
278278
{
279279
extern "C" {
280280
#[linkage = "extern_weak"]

Diff for: patches/0028-coretests-Disable-long-running-tests.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ index 8402833..84592e0 100644
3636
#[cfg(not(miri))] // unused in Miri
3737
macro_rules! empty_max_mut {
3838
@@ -2485,6 +2486,7 @@ take_tests! {
39-
(take_mut_oob_max_range_to_inclusive, (..=usize::MAX), None, empty_max_mut!()),
40-
(take_mut_in_bounds_max_range_from, (usize::MAX..), Some(&mut [] as _), empty_max_mut!()),
39+
(split_off_mut_oob_max_range_to_inclusive, (..=usize::MAX), None, empty_max_mut!()),
40+
(split_off_mut_in_bounds_max_range_from, (usize::MAX..), Some(&mut [] as _), empty_max_mut!()),
4141
}
4242
+*/
4343

Diff for: rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "nightly-2025-01-20"
2+
channel = "nightly-2025-02-07"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]
44
profile = "minimal"

Diff for: scripts/test_rustc_tests.sh

+16-6
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,18 @@ rm tests/ui/match/match-float.rs
8383
# ==================
8484
rm tests/ui/codegen/issue-28950.rs # depends on stack size optimizations
8585
rm tests/ui/codegen/init-large-type.rs # same
86-
rm tests/ui/issues/issue-40883.rs # same
8786
rm -r tests/run-make/fmt-write-bloat/ # tests an optimization
8887
rm tests/ui/statics/const_generics.rs # same
8988

9089
# backend specific tests
9190
# ======================
9291
rm tests/incremental/thinlto/cgu_invalidated_when_import_{added,removed}.rs # requires LLVM
9392
rm -r tests/run-make/cross-lang-lto # same
94-
rm -r tests/run-make/sepcomp-inlining # same
95-
rm -r tests/run-make/sepcomp-separate # same
96-
rm -r tests/run-make/sepcomp-cci-copies # same
9793
rm -r tests/run-make/volatile-intrinsics # same
9894
rm -r tests/run-make/llvm-ident # same
9995
rm -r tests/run-make/no-builtins-attribute # same
10096
rm -r tests/run-make/pgo-gen-no-imp-symbols # same
97+
rm -r tests/run-make/llvm-location-discriminator-limit-dummy-span # same
10198
rm tests/ui/abi/stack-protector.rs # requires stack protector support
10299
rm -r tests/run-make/emit-stack-sizes # requires support for -Z emit-stack-sizes
103100
rm -r tests/run-make/optimization-remarks-dir # remarks are LLVM specific
@@ -130,6 +127,7 @@ rm tests/ui/abi/large-byval-align.rs # exceeds implementation limit of Cranelift
130127
rm -r tests/run-make/remap-path-prefix-dwarf # requires llvm-dwarfdump
131128
rm -r tests/run-make/strip # same
132129
rm -r tests/run-make/compiler-builtins # Expects lib/rustlib/src/rust to contains the standard library source
130+
rm -r tests/run-make/translation # same
133131
rm -r tests/run-make/missing-unstable-trait-bound # This disables support for unstable features, but running cg_clif needs some unstable features
134132
rm -r tests/run-make/const-trait-stable-toolchain # same
135133
rm -r tests/run-make/incr-add-rust-src-component
@@ -156,8 +154,6 @@ cp $(../dist/rustc-clif --print target-libdir)/libstd-*.so ../dist/lib/
156154

157155
# prevent $(RUSTDOC) from picking up the sysroot built by x.py. It conflicts with the one used by
158156
# rustdoc-clif
159-
# FIXME remove the bootstrap changes once it is no longer necessary to revert rust-lang/rust#130642
160-
# to avoid building rustc when testing stage0 run-make.
161157
cat <<EOF | git apply -
162158
diff --git a/tests/run-make/tools.mk b/tests/run-make/tools.mk
163159
index ea06b620c4c..b969d0009c6 100644
@@ -196,6 +192,20 @@ index e7ae773ffa1d3..04bc2d7787da7 100644
196192
// Provide necessary library search paths for rustc.
197193
.env(dylib_env_var(), &env::join_paths(host_dylib_search_paths).unwrap());
198194
195+
diff --git a/tests/run-make/linker-warning/rmake.rs b/tests/run-make/linker-warning/rmake.rs
196+
index 30387af428c..f7895b12961 100644
197+
--- a/tests/run-make/linker-warning/rmake.rs
198+
+++ b/tests/run-make/linker-warning/rmake.rs
199+
@@ -57,7 +57,8 @@ fn main() {
200+
.actual_text("(linker error)", out.stderr())
201+
- .normalize(r#"/rustc[^/]*/"#, "/rustc/")
202+
+ .normalize(r#"/tmp/rustc[^/]*/"#, "/tmp/rustc/")
203+
+ .normalize("libpanic_abort", "libpanic_unwind")
204+
.normalize(
205+
regex::escape(run_make_support::build_root().to_str().unwrap()),
206+
"/build-root",
207+
)
208+
.run();
199209
EOF
200210

201211
echo "[TEST] rustc test suite"

Diff for: src/compiler_builtins.rs

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ builtin_functions! {
4444
fn __umodti3(n: u128, d: u128) -> u128;
4545
fn __modti3(n: i128, d: i128) -> i128;
4646
fn __rust_u128_mulo(a: u128, b: u128, oflow: &mut i32) -> u128;
47+
fn __rust_i128_mulo(a: i128, b: i128, oflow: &mut i32) -> i128;
4748

4849
// floats
4950
fn __floattisf(i: i128) -> f32;

Diff for: src/driver/jit.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ unsafe impl Send for UnsafeMessage {}
4646

4747
impl UnsafeMessage {
4848
/// Send the message.
49-
fn send(self) -> Result<(), mpsc::SendError<UnsafeMessage>> {
49+
fn send(self) {
5050
thread_local! {
5151
/// The Sender owned by the local thread
5252
static LOCAL_MESSAGE_SENDER: mpsc::Sender<UnsafeMessage> =
@@ -55,7 +55,9 @@ impl UnsafeMessage {
5555
.lock().unwrap()
5656
.clone();
5757
}
58-
LOCAL_MESSAGE_SENDER.with(|sender| sender.send(self))
58+
LOCAL_MESSAGE_SENDER.with(|sender| {
59+
sender.send(self).expect("rustc thread hung up before lazy JIT request was sent")
60+
})
5961
}
6062
}
6163

@@ -90,7 +92,7 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, codegen_mode: CodegenMode, jit_args: Vec<
9092
create_jit_module(tcx, matches!(codegen_mode, CodegenMode::JitLazy));
9193
let mut cached_context = Context::new();
9294

93-
let (_, cgus) = tcx.collect_and_partition_mono_items(());
95+
let cgus = tcx.collect_and_partition_mono_items(()).codegen_units;
9496
let mono_items = cgus
9597
.iter()
9698
.map(|cgu| cgu.items_in_deterministic_order(tcx).into_iter())
@@ -231,9 +233,7 @@ extern "C" fn clif_jit_fn(
231233
) -> *const u8 {
232234
// send the JIT request to the rustc thread, with a channel for the response
233235
let (tx, rx) = mpsc::channel();
234-
UnsafeMessage::JitFn { instance_ptr, trampoline_ptr, tx }
235-
.send()
236-
.expect("rustc thread hung up before lazy JIT request was sent");
236+
UnsafeMessage::JitFn { instance_ptr, trampoline_ptr, tx }.send();
237237

238238
// block on JIT compilation result
239239
rx.recv().expect("rustc thread hung up before responding to sent lazy JIT request")

0 commit comments

Comments
 (0)