Skip to content

Commit 4f24d14

Browse files
committed
Merge commit '979dcf8e2f213e4f4b645cb62e7fe9f4f2c0c785' into sync_cg_clif-2025-05-25
1 parent ff1a5ab commit 4f24d14

36 files changed

+1110
-265
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434
- name: Rustfmt
3535
run: |
3636
cargo fmt --check
37-
rustfmt --check build_system/main.rs
38-
rustfmt --check example/*
39-
rustfmt --check scripts/*.rs
37+
rustfmt --check --edition 2024 build_system/main.rs
38+
rustfmt --check --edition 2024 example/*
39+
rustfmt --check --edition 2024 scripts/*.rs
4040
4141
4242
test:

Cargo.lock

Lines changed: 45 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ crate-type = ["dylib"]
88

99
[dependencies]
1010
# These have to be in sync with each other
11-
cranelift-codegen = { version = "0.118.0", default-features = false, features = ["std", "timing", "unwind", "all-native-arch"] }
12-
cranelift-frontend = { version = "0.118.0" }
13-
cranelift-module = { version = "0.118.0" }
14-
cranelift-native = { version = "0.118.0" }
15-
cranelift-jit = { version = "0.118.0", optional = true }
16-
cranelift-object = { version = "0.118.0" }
11+
cranelift-codegen = { version = "0.120.0", default-features = false, features = ["std", "timing", "unwind", "all-native-arch"] }
12+
cranelift-frontend = { version = "0.120.0" }
13+
cranelift-module = { version = "0.120.0" }
14+
cranelift-native = { version = "0.120.0" }
15+
cranelift-jit = { version = "0.120.0", optional = true }
16+
cranelift-object = { version = "0.120.0" }
1717
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"] }
@@ -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-31.0.0", version = "0.118.0" }
28-
#cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-31.0.0", version = "0.118.0" }
29-
#cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-31.0.0", version = "0.118.0" }
30-
#cranelift-native = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-31.0.0", version = "0.118.0" }
31-
#cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-31.0.0", version = "0.118.0" }
32-
#cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-31.0.0", version = "0.118.0" }
27+
#cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-33.0.0", version = "0.120.0" }
28+
#cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-33.0.0", version = "0.120.0" }
29+
#cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-33.0.0", version = "0.120.0" }
30+
#cranelift-native = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-33.0.0", version = "0.120.0" }
31+
#cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-33.0.0", version = "0.120.0" }
32+
#cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-33.0.0", version = "0.120.0" }
3333

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

Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ If not please open an issue.
77

88
## Download using Rustup
99

10-
The Cranelift codegen backend is distributed in nightly builds on Linux and x86_64 macOS. If you want to
10+
The Cranelift codegen backend is distributed in nightly builds on Linux, macOS and x86_64 Windows. If you want to
1111
install it using Rustup, you can do that by running:
1212

1313
```bash
@@ -79,7 +79,7 @@ For more docs on how to build and test see [build_system/usage.txt](build_system
7979
Not all targets are available as rustup component for nightly. See notes in the platform support matrix.
8080

8181
[^xcoff]: XCOFF object file format is not supported.
82-
[^no-rustup]: Not available as rustup component for nightly. You can build it yourself.
82+
[^no-rustup]: Not available as [rustup component for nightly](https://rust-lang.github.io/rustup-components-history/). You can build it yourself.
8383

8484
## Usage
8585

build_system/build_backend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub(crate) fn build_backend(
1818
let mut cmd = CG_CLIF.build(&bootstrap_host_compiler, dirs);
1919

2020
let mut rustflags = rustflags_from_env("RUSTFLAGS");
21-
rustflags.push("-Zallow-features=rustc_private".to_owned());
21+
rustflags.push("-Zallow-features=rustc_private,f16,f128".to_owned());
2222
rustflags_to_cmd_env(&mut cmd, "RUSTFLAGS", &rustflags);
2323

2424
if env::var("CG_CLIF_EXPENSIVE_CHECKS").is_ok() {

build_system/build_sysroot.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ fn build_llvm_sysroot_for_triple(compiler: Compiler) -> SysrootTarget {
168168
let file_name_str = file.file_name().unwrap().to_str().unwrap();
169169
if (file_name_str.contains("rustc_")
170170
&& !file_name_str.contains("rustc_std_workspace_")
171-
&& !file_name_str.contains("rustc_demangle"))
171+
&& !file_name_str.contains("rustc_demangle")
172+
&& !file_name_str.contains("rustc_literal_escaper"))
172173
|| file_name_str.contains("chalk")
173174
|| file_name_str.contains("tracing")
174175
|| file_name_str.contains("regex")
@@ -234,7 +235,7 @@ fn build_clif_sysroot_for_triple(
234235
compiler.rustflags.extend(rustflags);
235236
let mut build_cmd = STANDARD_LIBRARY.build(&compiler, dirs);
236237
build_cmd.arg("--release");
237-
build_cmd.arg("--features").arg("backtrace panic-unwind compiler-builtins-no-f16-f128");
238+
build_cmd.arg("--features").arg("backtrace panic-unwind");
238239
build_cmd.arg(format!("-Zroot-dir={}", STDLIB_SRC.to_path(dirs).display()));
239240
build_cmd.env("CARGO_PROFILE_RELEASE_DEBUG", "true");
240241
build_cmd.env("__CARGO_DEFAULT_LIB_METADATA", "cg_clif");

docs/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ These are a few functions that allow you to easily run rust code from the shell
4747

4848
```bash
4949
function jit_naked() {
50-
echo "$@" | $cg_clif_dir/dist/rustc-clif - -Zunstable-options -Cllvm-args=jit-mode-Cprefer-dynamic
50+
echo "$@" | $cg_clif_dir/dist/rustc-clif - -Zunstable-options -Cllvm-args=jit-mode -Cprefer-dynamic
5151
}
5252

5353
function jit() {

example/mini_core.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,28 @@ fn panic_cannot_unwind() -> ! {
521521
}
522522

523523
#[lang = "eh_personality"]
524-
fn eh_personality() -> ! {
524+
// FIXME personality signature depends on target
525+
fn eh_personality(
526+
_version: i32,
527+
_actions: i32,
528+
_exception_class: u64,
529+
_exception_object: *mut (),
530+
_context: *mut (),
531+
) -> i32 {
525532
loop {}
526533
}
527534

535+
#[lang = "panic_in_cleanup"]
536+
fn panic_in_cleanup() -> ! {
537+
loop {}
538+
}
539+
540+
#[cfg(all(unix, not(target_vendor = "apple")))]
541+
#[link(name = "gcc_s")]
542+
extern "C" {
543+
fn _Unwind_Resume(exc: *mut ()) -> !;
544+
}
545+
528546
#[lang = "drop_in_place"]
529547
#[allow(unconditional_recursion)]
530548
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {

example/std_example.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ fn main() {
166166
enum Never {}
167167
}
168168

169+
#[cfg(not(target_arch = "s390x"))] // s390x doesn't have vector instructions enabled by default
169170
foo(I64X2([0, 0]));
170171

171172
transmute_wide_pointer();
@@ -203,9 +204,11 @@ fn rust_call_abi() {
203204
rust_call_abi_callee((1, 2));
204205
}
205206

207+
#[cfg_attr(target_arch = "s390x", allow(dead_code))]
206208
#[repr(simd)]
207209
struct I64X2([i64; 2]);
208210

211+
#[cfg_attr(target_arch = "s390x", allow(dead_code))]
209212
#[allow(improper_ctypes_definitions)]
210213
extern "C" fn foo(_a: I64X2) {}
211214

patches/0027-stdlib-128bit-atomic-operations.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs
3737
index bf2b6d59f88..d5ccce03bbf 100644
3838
--- a/library/core/src/sync/atomic.rs
3939
+++ b/library/core/src/sync/atomic.rs
40+
@@ -300,8 +300,6 @@ impl_atomic_primitive!(AtomicI32(i32), size("32"), align(4));
41+
impl_atomic_primitive!(AtomicU32(u32), size("32"), align(4));
42+
impl_atomic_primitive!(AtomicI64(i64), size("64"), align(8));
43+
impl_atomic_primitive!(AtomicU64(u64), size("64"), align(8));
44+
-impl_atomic_primitive!(AtomicI128(i128), size("128"), align(16));
45+
-impl_atomic_primitive!(AtomicU128(u128), size("128"), align(16));
46+
47+
#[cfg(target_pointer_width = "16")]
48+
impl_atomic_primitive!(AtomicIsize(isize), size("ptr"), align(2));
4049
@@ -3585,44 +3585,6 @@ pub const fn as_ptr(&self) -> *mut $int_type {
4150
8,
4251
u64 AtomicU64

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "nightly-2025-03-30"
2+
channel = "nightly-2025-05-25"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]
44
profile = "minimal"

scripts/setup_rust_fork.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ verbose-tests = false
4343
# disabled bootstrap will crash trying to copy llvm tools for the bootstrap
4444
# compiler.
4545
llvm-tools = false
46-
std-features = ["panic-unwind", "compiler-builtins-no-f16-f128"]
46+
std-features = ["panic-unwind"]
4747
4848
EOF
4949

0 commit comments

Comments
 (0)