Skip to content

Commit 02b85d7

Browse files
committed
Auto merge of rust-lang#81625 - jonas-schievink:rollup-mshpp2n, r=jonas-schievink
Rollup of 12 pull requests Successful merges: - rust-lang#78641 (Let io::copy reuse BufWriter buffers) - rust-lang#79291 (Add error message for private fn) - rust-lang#81364 (Improve `rustc_mir_build::matches` docs) - rust-lang#81387 (Move some tests to more reasonable directories - 3) - rust-lang#81463 (Rename NLL* to Nll* accordingly to C-CASE) - rust-lang#81504 (Suggest accessing field when appropriate) - rust-lang#81529 (Fix invalid camel case suggestion involving unicode idents) - rust-lang#81536 (Indicate both start and end of pass RSS in time-passes output) - rust-lang#81592 (Rustdoc UI fixes) - rust-lang#81594 (Avoid building LLVM just for llvm-dwp) - rust-lang#81598 (Fix calling convention for CRT startup) - rust-lang#81618 (Sync rustc_codegen_cranelift) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 70b18bc + b3339ab commit 02b85d7

File tree

137 files changed

+1679
-919
lines changed

Some content is hidden

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

137 files changed

+1679
-919
lines changed

Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -4133,6 +4133,7 @@ dependencies = [
41334133
"rustc_middle",
41344134
"rustc_session",
41354135
"rustc_span",
4136+
"rustc_trait_selection",
41364137
"rustc_typeck",
41374138
"tracing",
41384139
]

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
os: [ubuntu-latest, macos-latest]
15+
env:
16+
- BACKEND: ""
17+
- BACKEND: --oldbe
1518

1619
steps:
1720
- uses: actions/checkout@v2
@@ -51,7 +54,7 @@ jobs:
5154
export COMPILE_RUNS=2
5255
export RUN_RUNS=2
5356
54-
./test.sh
57+
./test.sh $BACKEND
5558
5659
- name: Package prebuilt cg_clif
5760
run: tar cvfJ cg_clif.tar.xz build

compiler/rustc_codegen_cranelift/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ perf.data.old
88
*.string*
99
/build
1010
/build_sysroot/sysroot_src
11+
/build_sysroot/compiler-builtins
1112
/rust
1213
/rand
1314
/regex

compiler/rustc_codegen_cranelift/.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
// source for rustc_* is not included in the rust-src component; disable the errors about this
33
"rust-analyzer.diagnostics.disabled": ["unresolved-extern-crate"],
4-
"rust-analyzer.assist.importMergeBehaviour": "last",
4+
"rust-analyzer.assist.importMergeBehavior": "last",
55
"rust-analyzer.cargo.loadOutDirsFromCheck": true,
66
"rust-analyzer.linkedProjects": [
77
"./Cargo.toml",

compiler/rustc_codegen_cranelift/Cargo.lock

+45-44
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# It is not intended for manual editing.
33
[[package]]
44
name = "anyhow"
5-
version = "1.0.34"
5+
version = "1.0.38"
66
source = "registry+https://github.com/rust-lang/crates.io-index"
7-
checksum = "bf8dcb5b4bbaa28653b647d8c77bd4ed40183b48882e130c1f1ffb73de069fd7"
7+
checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1"
88

99
[[package]]
1010
name = "ar"
@@ -25,15 +25,15 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
2525

2626
[[package]]
2727
name = "byteorder"
28-
version = "1.3.4"
28+
version = "1.4.2"
2929
source = "registry+https://github.com/rust-lang/crates.io-index"
30-
checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
30+
checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b"
3131

3232
[[package]]
3333
name = "cc"
34-
version = "1.0.62"
34+
version = "1.0.66"
3535
source = "registry+https://github.com/rust-lang/crates.io-index"
36-
checksum = "f1770ced377336a88a67c473594ccc14eca6f4559217c34f64aac8f83d641b40"
36+
checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48"
3737

3838
[[package]]
3939
name = "cfg-if"
@@ -49,16 +49,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
4949

5050
[[package]]
5151
name = "cranelift-bforest"
52-
version = "0.68.0"
53-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8f7f8ee0b4c5007ace6de29b45505c360450b1bb"
52+
version = "0.69.0"
53+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#986b5768f9e68f1564b43f32b8a4080a6582c8ca"
5454
dependencies = [
5555
"cranelift-entity",
5656
]
5757

5858
[[package]]
5959
name = "cranelift-codegen"
60-
version = "0.68.0"
61-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8f7f8ee0b4c5007ace6de29b45505c360450b1bb"
60+
version = "0.69.0"
61+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#986b5768f9e68f1564b43f32b8a4080a6582c8ca"
6262
dependencies = [
6363
"byteorder",
6464
"cranelift-bforest",
@@ -75,27 +75,27 @@ dependencies = [
7575

7676
[[package]]
7777
name = "cranelift-codegen-meta"
78-
version = "0.68.0"
79-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8f7f8ee0b4c5007ace6de29b45505c360450b1bb"
78+
version = "0.69.0"
79+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#986b5768f9e68f1564b43f32b8a4080a6582c8ca"
8080
dependencies = [
8181
"cranelift-codegen-shared",
8282
"cranelift-entity",
8383
]
8484

8585
[[package]]
8686
name = "cranelift-codegen-shared"
87-
version = "0.68.0"
88-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8f7f8ee0b4c5007ace6de29b45505c360450b1bb"
87+
version = "0.69.0"
88+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#986b5768f9e68f1564b43f32b8a4080a6582c8ca"
8989

9090
[[package]]
9191
name = "cranelift-entity"
92-
version = "0.68.0"
93-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8f7f8ee0b4c5007ace6de29b45505c360450b1bb"
92+
version = "0.69.0"
93+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#986b5768f9e68f1564b43f32b8a4080a6582c8ca"
9494

9595
[[package]]
9696
name = "cranelift-frontend"
97-
version = "0.68.0"
98-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8f7f8ee0b4c5007ace6de29b45505c360450b1bb"
97+
version = "0.69.0"
98+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#986b5768f9e68f1564b43f32b8a4080a6582c8ca"
9999
dependencies = [
100100
"cranelift-codegen",
101101
"log",
@@ -105,8 +105,8 @@ dependencies = [
105105

106106
[[package]]
107107
name = "cranelift-jit"
108-
version = "0.68.0"
109-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8f7f8ee0b4c5007ace6de29b45505c360450b1bb"
108+
version = "0.69.0"
109+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#986b5768f9e68f1564b43f32b8a4080a6582c8ca"
110110
dependencies = [
111111
"anyhow",
112112
"cranelift-codegen",
@@ -123,8 +123,8 @@ dependencies = [
123123

124124
[[package]]
125125
name = "cranelift-module"
126-
version = "0.68.0"
127-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8f7f8ee0b4c5007ace6de29b45505c360450b1bb"
126+
version = "0.69.0"
127+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#986b5768f9e68f1564b43f32b8a4080a6582c8ca"
128128
dependencies = [
129129
"anyhow",
130130
"cranelift-codegen",
@@ -135,8 +135,8 @@ dependencies = [
135135

136136
[[package]]
137137
name = "cranelift-native"
138-
version = "0.68.0"
139-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8f7f8ee0b4c5007ace6de29b45505c360450b1bb"
138+
version = "0.69.0"
139+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#986b5768f9e68f1564b43f32b8a4080a6582c8ca"
140140
dependencies = [
141141
"cranelift-codegen",
142142
"raw-cpuid",
@@ -145,8 +145,8 @@ dependencies = [
145145

146146
[[package]]
147147
name = "cranelift-object"
148-
version = "0.68.0"
149-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8f7f8ee0b4c5007ace6de29b45505c360450b1bb"
148+
version = "0.69.0"
149+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#986b5768f9e68f1564b43f32b8a4080a6582c8ca"
150150
dependencies = [
151151
"anyhow",
152152
"cranelift-codegen",
@@ -209,35 +209,35 @@ checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
209209

210210
[[package]]
211211
name = "indexmap"
212-
version = "1.6.0"
212+
version = "1.6.1"
213213
source = "registry+https://github.com/rust-lang/crates.io-index"
214-
checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2"
214+
checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b"
215215
dependencies = [
216216
"autocfg",
217217
"hashbrown",
218218
]
219219

220220
[[package]]
221221
name = "libc"
222-
version = "0.2.80"
222+
version = "0.2.82"
223223
source = "registry+https://github.com/rust-lang/crates.io-index"
224-
checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614"
224+
checksum = "89203f3fba0a3795506acaad8ebce3c80c0af93f994d5a1d7a0b1eeb23271929"
225225

226226
[[package]]
227227
name = "libloading"
228-
version = "0.6.5"
228+
version = "0.6.7"
229229
source = "registry+https://github.com/rust-lang/crates.io-index"
230-
checksum = "1090080fe06ec2648d0da3881d9453d97e71a45f00eb179af7fdd7e3f686fdb0"
230+
checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883"
231231
dependencies = [
232232
"cfg-if 1.0.0",
233233
"winapi",
234234
]
235235

236236
[[package]]
237237
name = "log"
238-
version = "0.4.11"
238+
version = "0.4.13"
239239
source = "registry+https://github.com/rust-lang/crates.io-index"
240-
checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
240+
checksum = "fcf3805d4480bb5b86070dcfeb9e2cb2ebc148adb753c5cca5f884d1d65a42b2"
241241
dependencies = [
242242
"cfg-if 0.1.10",
243243
]
@@ -272,9 +272,9 @@ dependencies = [
272272

273273
[[package]]
274274
name = "quote"
275-
version = "1.0.7"
275+
version = "1.0.8"
276276
source = "registry+https://github.com/rust-lang/crates.io-index"
277-
checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
277+
checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df"
278278
dependencies = [
279279
"proc-macro2",
280280
]
@@ -333,6 +333,7 @@ dependencies = [
333333
"indexmap",
334334
"libloading",
335335
"object",
336+
"smallvec",
336337
"target-lexicon",
337338
]
338339

@@ -362,15 +363,15 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
362363

363364
[[package]]
364365
name = "smallvec"
365-
version = "1.4.2"
366+
version = "1.6.1"
366367
source = "registry+https://github.com/rust-lang/crates.io-index"
367-
checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"
368+
checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
368369

369370
[[package]]
370371
name = "syn"
371-
version = "1.0.48"
372+
version = "1.0.58"
372373
source = "registry+https://github.com/rust-lang/crates.io-index"
373-
checksum = "cc371affeffc477f42a221a1e4297aedcea33d47d19b61455588bd9d8f6b19ac"
374+
checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5"
374375
dependencies = [
375376
"proc-macro2",
376377
"quote",
@@ -385,18 +386,18 @@ checksum = "4ee5a98e506fb7231a304c3a1bd7c132a55016cf65001e0282480665870dfcb9"
385386

386387
[[package]]
387388
name = "thiserror"
388-
version = "1.0.22"
389+
version = "1.0.23"
389390
source = "registry+https://github.com/rust-lang/crates.io-index"
390-
checksum = "0e9ae34b84616eedaaf1e9dd6026dbe00dcafa92aa0c8077cb69df1fcfe5e53e"
391+
checksum = "76cc616c6abf8c8928e2fdcc0dbfab37175edd8fb49a4641066ad1364fdab146"
391392
dependencies = [
392393
"thiserror-impl",
393394
]
394395

395396
[[package]]
396397
name = "thiserror-impl"
397-
version = "1.0.22"
398+
version = "1.0.23"
398399
source = "registry+https://github.com/rust-lang/crates.io-index"
399-
checksum = "9ba20f23e85b10754cd195504aebf6a27e2e6cbe28c17778a0c930724628dd56"
400+
checksum = "9be73a2caec27583d0046ef3796c3794f868a5bc813db689eed00c7631275cd1"
400401
dependencies = [
401402
"proc-macro2",
402403
"quote",

compiler/rustc_codegen_cranelift/Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ crate-type = ["dylib"]
99

1010
[dependencies]
1111
# These have to be in sync with each other
12-
cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime/", branch = "main", features = ["unwind"] }
12+
cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime/", branch = "main", features = ["unwind", "x86", "x64"] }
1313
cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime/", branch = "main" }
1414
cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime/", branch = "main" }
1515
cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime/", branch = "main", optional = true }
@@ -21,6 +21,7 @@ object = { version = "0.22.0", default-features = false, features = ["std", "rea
2121
ar = { git = "https://github.com/bjorn3/rust-ar.git", branch = "do_not_remove_cg_clif_ranlib" }
2222
indexmap = "1.0.2"
2323
libloading = { version = "0.6.0", optional = true }
24+
smallvec = "1.6.1"
2425

2526
# Uncomment to use local checkout of cranelift
2627
#[patch."https://github.com/bytecodealliance/wasmtime/"]
@@ -37,6 +38,7 @@ libloading = { version = "0.6.0", optional = true }
3738
default = ["jit", "inline_asm"]
3839
jit = ["cranelift-jit", "libloading"]
3940
inline_asm = []
41+
oldbe = []
4042

4143
[profile.dev]
4244
# By compiling dependencies with optimizations, performing tests gets much faster.

compiler/rustc_codegen_cranelift/Readme.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# WIP Cranelift codegen backend for rust
2-
3-
> ⚠⚠⚠ Certain kinds of FFI don't work yet. ⚠⚠⚠
1+
# Cranelift codegen backend for rust
42

53
The goal of this project is to create an alternative codegen backend for the rust compiler based on [Cranelift](https://github.com/bytecodealliance/wasmtime/blob/main/cranelift).
64
This has the potential to improve compilation times in debug mode.
@@ -103,8 +101,7 @@ function jit_calc() {
103101

104102
## Not yet supported
105103

106-
* Good non-rust abi support ([several problems](https://github.com/bjorn3/rustc_codegen_cranelift/issues/10))
107-
* Inline assembly ([no cranelift support](https://github.com/bytecodealliance/wasmtime/issues/1041)
104+
* Inline assembly ([no cranelift support](https://github.com/bytecodealliance/wasmtime/issues/1041))
108105
* On Linux there is support for invoking an external assembler for `global_asm!` and `asm!`.
109106
`llvm_asm!` will remain unimplemented forever. `asm!` doesn't yet support reg classes. You
110107
have to specify specific registers instead.

0 commit comments

Comments
 (0)