Skip to content

Commit 5ad7389

Browse files
committed
Auto merge of rust-lang#87822 - JohnTitor:rollup-kxojii0, r=JohnTitor
Rollup of 7 pull requests Successful merges: - rust-lang#85807 (bootstrap: Disable initial-exec TLS model on powerpc) - rust-lang#87761 (Fix overflow in rustc happening if the `err_count()` is reduced in a stage.) - rust-lang#87775 (Add hint for unresolved associated trait items if the trait has a single item) - rust-lang#87779 (Remove special case for statement `NodeId` assignment) - rust-lang#87787 (Use `C-unwind` ABI for `__rust_start_panic` in `panic_abort`) - rust-lang#87809 (Fix typo in the ptr documentation) - rust-lang#87816 (Sync rustc_codegen_cranelift) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 24380a6 + 0de0b88 commit 5ad7389

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1008
-652
lines changed

compiler/rustc_codegen_cranelift/.github/workflows/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ jobs:
4949
- name: Install MinGW toolchain and wine
5050
if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
5151
run: |
52+
sudo apt-get update
5253
sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
5354
rustup target add x86_64-pc-windows-gnu
5455
5556
- name: Install AArch64 toolchain and qemu
5657
if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'aarch64-unknown-linux-gnu'
5758
run: |
59+
sudo apt-get update
5860
sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user
5961
6062
- name: Prepare dependencies

compiler/rustc_codegen_cranelift/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ perf.data.old
1515
/rand
1616
/regex
1717
/simple-raytracer
18+
/stdsimd

compiler/rustc_codegen_cranelift/Cargo.lock

+24-24
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ version = 3
44

55
[[package]]
66
name = "anyhow"
7-
version = "1.0.38"
7+
version = "1.0.42"
88
source = "registry+https://github.com/rust-lang/crates.io-index"
9-
checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1"
9+
checksum = "595d3cfa7a60d4555cb5067b99f07142a08ea778de5cf993f7b75c7d8fabc486"
1010

1111
[[package]]
1212
name = "ar"
@@ -34,15 +34,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
3434
[[package]]
3535
name = "cranelift-bforest"
3636
version = "0.75.0"
37-
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
37+
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
3838
dependencies = [
3939
"cranelift-entity",
4040
]
4141

4242
[[package]]
4343
name = "cranelift-codegen"
4444
version = "0.75.0"
45-
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
45+
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
4646
dependencies = [
4747
"cranelift-bforest",
4848
"cranelift-codegen-meta",
@@ -58,7 +58,7 @@ dependencies = [
5858
[[package]]
5959
name = "cranelift-codegen-meta"
6060
version = "0.75.0"
61-
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
61+
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
6262
dependencies = [
6363
"cranelift-codegen-shared",
6464
"cranelift-entity",
@@ -67,17 +67,17 @@ dependencies = [
6767
[[package]]
6868
name = "cranelift-codegen-shared"
6969
version = "0.75.0"
70-
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
70+
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
7171

7272
[[package]]
7373
name = "cranelift-entity"
7474
version = "0.75.0"
75-
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
75+
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
7676

7777
[[package]]
7878
name = "cranelift-frontend"
7979
version = "0.75.0"
80-
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
80+
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
8181
dependencies = [
8282
"cranelift-codegen",
8383
"log",
@@ -88,7 +88,7 @@ dependencies = [
8888
[[package]]
8989
name = "cranelift-jit"
9090
version = "0.75.0"
91-
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
91+
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
9292
dependencies = [
9393
"anyhow",
9494
"cranelift-codegen",
@@ -105,7 +105,7 @@ dependencies = [
105105
[[package]]
106106
name = "cranelift-module"
107107
version = "0.75.0"
108-
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
108+
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
109109
dependencies = [
110110
"anyhow",
111111
"cranelift-codegen",
@@ -116,7 +116,7 @@ dependencies = [
116116
[[package]]
117117
name = "cranelift-native"
118118
version = "0.75.0"
119-
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
119+
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
120120
dependencies = [
121121
"cranelift-codegen",
122122
"libc",
@@ -126,7 +126,7 @@ dependencies = [
126126
[[package]]
127127
name = "cranelift-object"
128128
version = "0.75.0"
129-
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
129+
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
130130
dependencies = [
131131
"anyhow",
132132
"cranelift-codegen",
@@ -147,34 +147,34 @@ dependencies = [
147147

148148
[[package]]
149149
name = "gimli"
150-
version = "0.24.0"
150+
version = "0.25.0"
151151
source = "registry+https://github.com/rust-lang/crates.io-index"
152-
checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189"
152+
checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7"
153153
dependencies = [
154154
"indexmap",
155155
]
156156

157157
[[package]]
158158
name = "hashbrown"
159-
version = "0.9.1"
159+
version = "0.11.2"
160160
source = "registry+https://github.com/rust-lang/crates.io-index"
161-
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
161+
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
162162

163163
[[package]]
164164
name = "indexmap"
165-
version = "1.6.1"
165+
version = "1.7.0"
166166
source = "registry+https://github.com/rust-lang/crates.io-index"
167-
checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b"
167+
checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
168168
dependencies = [
169169
"autocfg",
170170
"hashbrown",
171171
]
172172

173173
[[package]]
174174
name = "libc"
175-
version = "0.2.97"
175+
version = "0.2.98"
176176
source = "registry+https://github.com/rust-lang/crates.io-index"
177-
checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6"
177+
checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"
178178

179179
[[package]]
180180
name = "libloading"
@@ -212,9 +212,9 @@ checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc"
212212

213213
[[package]]
214214
name = "object"
215-
version = "0.25.3"
215+
version = "0.26.0"
216216
source = "registry+https://github.com/rust-lang/crates.io-index"
217-
checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7"
217+
checksum = "c55827317fb4c08822499848a14237d2874d6f139828893017237e7ab93eb386"
218218
dependencies = [
219219
"crc32fast",
220220
"indexmap",
@@ -277,9 +277,9 @@ checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
277277

278278
[[package]]
279279
name = "target-lexicon"
280-
version = "0.12.0"
280+
version = "0.12.1"
281281
source = "registry+https://github.com/rust-lang/crates.io-index"
282-
checksum = "64ae3b39281e4b14b8123bdbaddd472b7dfe215e444181f2f9d2443c2444f834"
282+
checksum = "b0652da4c4121005e9ed22b79f6c5f2d9e2752906b53a33e9490489ba421a6fb"
283283

284284
[[package]]
285285
name = "winapi"

compiler/rustc_codegen_cranelift/Cargo.toml

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

99
[dependencies]
1010
# These have to be in sync with each other
11-
cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main", features = ["unwind", "all-arch"] }
12-
cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main" }
13-
cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main" }
14-
cranelift-native = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main" }
15-
cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main", optional = true }
16-
cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main" }
11+
cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime.git", features = ["unwind", "all-arch"] }
12+
cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime.git" }
13+
cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime.git" }
14+
cranelift-native = { git = "https://github.com/bytecodealliance/wasmtime.git" }
15+
cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime.git", optional = true }
16+
cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime.git" }
1717
target-lexicon = "0.12.0"
18-
gimli = { version = "0.24.0", default-features = false, features = ["write"]}
19-
object = { version = "0.25.0", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }
18+
gimli = { version = "0.25.0", default-features = false, features = ["write"]}
19+
object = { version = "0.26.0", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }
2020

2121
ar = { git = "https://github.com/bjorn3/rust-ar.git", branch = "do_not_remove_cg_clif_ranlib" }
2222
indexmap = "1.0.2"
@@ -36,7 +36,8 @@ smallvec = "1.6.1"
3636
#gimli = { path = "../" }
3737

3838
[features]
39-
default = ["jit", "inline_asm"]
39+
# Enable features not ready to be enabled when compiling as part of rustc
40+
unstable-features = ["jit", "inline_asm"]
4041
jit = ["cranelift-jit", "libloading"]
4142
inline_asm = []
4243

compiler/rustc_codegen_cranelift/build_sysroot/Cargo.lock

+4-13
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
4040

4141
[[package]]
4242
name = "cc"
43-
version = "1.0.68"
43+
version = "1.0.69"
4444
source = "registry+https://github.com/rust-lang/crates.io-index"
45-
checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787"
45+
checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2"
4646

4747
[[package]]
4848
name = "cfg-if"
@@ -132,9 +132,9 @@ dependencies = [
132132

133133
[[package]]
134134
name = "libc"
135-
version = "0.2.97"
135+
version = "0.2.98"
136136
source = "registry+https://github.com/rust-lang/crates.io-index"
137-
checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6"
137+
checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"
138138
dependencies = [
139139
"rustc-std-workspace-core",
140140
]
@@ -270,14 +270,6 @@ dependencies = [
270270
"test",
271271
]
272272

273-
[[package]]
274-
name = "term"
275-
version = "0.0.0"
276-
dependencies = [
277-
"core",
278-
"std",
279-
]
280-
281273
[[package]]
282274
name = "test"
283275
version = "0.0.0"
@@ -290,7 +282,6 @@ dependencies = [
290282
"panic_unwind",
291283
"proc_macro",
292284
"std",
293-
"term",
294285
]
295286

296287
[[package]]

compiler/rustc_codegen_cranelift/build_system/build_backend.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::process::Command;
44

55
pub(crate) fn build_backend(channel: &str, host_triple: &str) -> PathBuf {
66
let mut cmd = Command::new("cargo");
7-
cmd.arg("build").arg("--target").arg(host_triple);
7+
cmd.arg("build").arg("--target").arg(host_triple).arg("--features").arg("unstable-features");
88

99
match channel {
1010
"debug" => {}

compiler/rustc_codegen_cranelift/build_system/build_sysroot.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ pub(crate) fn build_sysroot(
9191
{
9292
let file = file.unwrap().path();
9393
let file_name_str = file.file_name().unwrap().to_str().unwrap();
94-
if file_name_str.contains("rustc_")
94+
if (file_name_str.contains("rustc_")
95+
&& !file_name_str.contains("rustc_std_workspace_")
96+
&& !file_name_str.contains("rustc_demangle"))
9597
|| file_name_str.contains("chalk")
9698
|| file_name_str.contains("tracing")
9799
|| file_name_str.contains("regex")

compiler/rustc_codegen_cranelift/build_system/prepare.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ pub(crate) fn prepare() {
2727
"341f207c1071f7290e3f228c710817c280c8dca1",
2828
);
2929

30+
clone_repo(
31+
"stdsimd",
32+
"https://github.com/rust-lang/stdsimd",
33+
"be96995d8ddec03fac9a0caf4d4c51c7fbc33507",
34+
);
35+
apply_patches("stdsimd", Path::new("stdsimd"));
36+
3037
clone_repo(
3138
"simple-raytracer",
3239
"https://github.com/ebobby/simple-raytracer",
@@ -60,11 +67,7 @@ fn prepare_sysroot() {
6067
copy_dir_recursively(&sysroot_src_orig.join("library"), &sysroot_src.join("library"));
6168

6269
let rustc_version = get_rustc_version();
63-
fs::write(
64-
Path::new("build_sysroot").join("rustc_version"),
65-
&rustc_version,
66-
)
67-
.unwrap();
70+
fs::write(Path::new("build_sysroot").join("rustc_version"), &rustc_version).unwrap();
6871

6972
eprintln!("[GIT] init");
7073
let mut git_init_cmd = Command::new("git");

compiler/rustc_codegen_cranelift/clean_all.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ set -e
33

44
rm -rf build_sysroot/{sysroot_src/,target/,compiler-builtins/,rustc_version}
55
rm -rf target/ build/ perf.data{,.old}
6-
rm -rf rand/ regex/ simple-raytracer/
6+
rm -rf rand/ regex/ simple-raytracer/ stdsimd/

compiler/rustc_codegen_cranelift/docs/usage.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $ $cg_clif_dir/build/cargo jit
3636
or
3737

3838
```bash
39-
$ $cg_clif_dir/build/bin/cg_clif -Cllvm-args=mode=jit -Cprefer-dynamic my_crate.rs
39+
$ $cg_clif_dir/build/bin/cg_clif -Zunstable-features -Cllvm-args=mode=jit -Cprefer-dynamic my_crate.rs
4040
```
4141

4242
There is also an experimental lazy jit mode. In this mode functions are only compiled once they are
@@ -52,7 +52,7 @@ These are a few functions that allow you to easily run rust code from the shell
5252

5353
```bash
5454
function jit_naked() {
55-
echo "$@" | $cg_clif_dir/build/bin/cg_clif - -Cllvm-args=mode=jit -Cprefer-dynamic
55+
echo "$@" | $cg_clif_dir/build/bin/cg_clif - -Zunstable-features -Cllvm-args=mode=jit -Cprefer-dynamic
5656
}
5757

5858
function jit() {

0 commit comments

Comments
 (0)