Skip to content

Commit 8e9d2b6

Browse files
author
Yuki Okushi
authored
Rollup merge of #103437 - bjorn3:sync_cg_clif-2022-10-23, r=bjorn3
Sync rustc_codegen_cranelift r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2 parents 413380f + e8ac073 commit 8e9d2b6

Some content is hidden

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

46 files changed

+1043
-638
lines changed

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

+68-31
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ jobs:
2929
matrix:
3030
include:
3131
- os: ubuntu-latest
32+
env:
33+
TARGET_TRIPLE: x86_64-unknown-linux-gnu
3234
- os: macos-latest
35+
env:
36+
TARGET_TRIPLE: x86_64-apple-darwin
3337
# cross-compile from Linux to Windows using mingw
3438
- os: ubuntu-latest
3539
env:
@@ -112,7 +116,7 @@ jobs:
112116
if: matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
113117
uses: actions/upload-artifact@v2
114118
with:
115-
name: cg_clif-${{ runner.os }}
119+
name: cg_clif-${{ matrix.env.TARGET_TRIPLE }}
116120
path: cg_clif.tar.xz
117121

118122
- name: Upload prebuilt cg_clif (cross compile)
@@ -122,56 +126,89 @@ jobs:
122126
name: cg_clif-${{ runner.os }}-cross-x86_64-mingw
123127
path: cg_clif.tar.xz
124128

125-
build_windows:
126-
runs-on: windows-latest
129+
windows:
130+
runs-on: ${{ matrix.os }}
127131
timeout-minutes: 60
128132

133+
strategy:
134+
fail-fast: false
135+
matrix:
136+
include:
137+
# Native Windows build with MSVC
138+
- os: windows-latest
139+
env:
140+
TARGET_TRIPLE: x86_64-pc-windows-msvc
141+
# cross-compile from Windows to Windows MinGW
142+
- os: windows-latest
143+
env:
144+
TARGET_TRIPLE: x86_64-pc-windows-gnu
145+
129146
steps:
130147
- uses: actions/checkout@v3
131148

132-
#- name: Cache cargo installed crates
133-
# uses: actions/cache@v2
134-
# with:
135-
# path: ~/.cargo/bin
136-
# key: ${{ runner.os }}-cargo-installed-crates
137-
138-
#- name: Cache cargo registry and index
139-
# uses: actions/cache@v2
140-
# with:
141-
# path: |
142-
# ~/.cargo/registry
143-
# ~/.cargo/git
144-
# key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
145-
146-
#- name: Cache cargo target dir
147-
# uses: actions/cache@v2
148-
# with:
149-
# path: target
150-
# key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
149+
- name: Cache cargo installed crates
150+
uses: actions/cache@v2
151+
with:
152+
path: ~/.cargo/bin
153+
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-installed-crates
154+
155+
- name: Cache cargo registry and index
156+
uses: actions/cache@v2
157+
with:
158+
path: |
159+
~/.cargo/registry
160+
~/.cargo/git
161+
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
162+
163+
- name: Cache cargo target dir
164+
uses: actions/cache@v2
165+
with:
166+
path: target
167+
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
168+
169+
- name: Set MinGW as the default toolchain
170+
if: matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
171+
run: rustup set default-host x86_64-pc-windows-gnu
151172

152173
- name: Prepare dependencies
153174
run: |
154175
git config --global user.email "[email protected]"
155176
git config --global user.name "User"
156177
git config --global core.autocrlf false
157-
rustup set default-host x86_64-pc-windows-gnu
158178
rustc y.rs -o y.exe -g
159179
./y.exe prepare
160180
181+
- name: Build without unstable features
182+
env:
183+
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
184+
# This is the config rust-lang/rust uses for builds
185+
run: ./y.rs build --no-unstable-features
186+
161187
- name: Build
162-
#name: Test
188+
run: ./y.rs build --sysroot none
189+
190+
- name: Test
163191
run: |
164192
# Enable backtraces for easier debugging
165-
#$Env:RUST_BACKTRACE=1
193+
$Env:RUST_BACKTRACE=1
166194
167195
# Reduce amount of benchmark runs as they are slow
168-
#$Env:COMPILE_RUNS=2
169-
#$Env:RUN_RUNS=2
196+
$Env:COMPILE_RUNS=2
197+
$Env:RUN_RUNS=2
170198
171199
# Enable extra checks
172-
#$Env:CG_CLIF_ENABLE_VERIFIER=1
173-
174-
./y.exe build
200+
$Env:CG_CLIF_ENABLE_VERIFIER=1
201+
202+
# WIP Disable some tests
203+
204+
# This fails due to some weird argument handling by hyperfine, not an actual regression
205+
# more of a build system issue
206+
(Get-Content config.txt) -replace '(bench.simple-raytracer)', '# $1' | Out-File config.txt
207+
208+
# This fails with a different output than expected
209+
(Get-Content config.txt) -replace '(test.regex-shootout-regex-dna)', '# $1' | Out-File config.txt
210+
211+
./y.exe test
175212
176213
- name: Package prebuilt cg_clif
177214
# don't use compression as xzip isn't supported by tar on windows and bzip2 hangs
@@ -180,5 +217,5 @@ jobs:
180217
- name: Upload prebuilt cg_clif
181218
uses: actions/upload-artifact@v2
182219
with:
183-
name: cg_clif-${{ runner.os }}
220+
name: cg_clif-${{ matrix.env.TARGET_TRIPLE }}
184221
path: cg_clif.tar

compiler/rustc_codegen_cranelift/.gitignore

+1-5
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,4 @@ perf.data.old
1515
/build_sysroot/compiler-builtins
1616
/build_sysroot/rustc_version
1717
/rust
18-
/rand
19-
/regex
20-
/simple-raytracer
21-
/portable-simd
22-
/abi-checker
18+
/download

compiler/rustc_codegen_cranelift/.vscode/settings.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"rust-analyzer.cargo.features": ["unstable-features"],
88
"rust-analyzer.linkedProjects": [
99
"./Cargo.toml",
10-
//"./build_sysroot/sysroot_src/src/libstd/Cargo.toml",
10+
//"./build_sysroot/sysroot_src/library/std/Cargo.toml",
1111
{
1212
"roots": [
1313
"./example/mini_core.rs",
@@ -36,10 +36,10 @@
3636
]
3737
},
3838
{
39-
"roots": ["./scripts/filter_profile.rs"],
39+
"roots": ["./example/std_example.rs"],
4040
"crates": [
4141
{
42-
"root_module": "./scripts/filter_profile.rs",
42+
"root_module": "./example/std_example.rs",
4343
"edition": "2018",
4444
"deps": [{ "crate": 1, "name": "std" }],
4545
"cfg": [],

compiler/rustc_codegen_cranelift/Cargo.lock

+38-24
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ name = "ar"
2424
version = "0.8.0"
2525
source = "git+https://github.com/bjorn3/rust-ar.git?branch=do_not_remove_cg_clif_ranlib#de9ab0e56bf3a208381d342aa5b60f9ff2891648"
2626

27+
[[package]]
28+
name = "arrayvec"
29+
version = "0.7.2"
30+
source = "registry+https://github.com/rust-lang/crates.io-index"
31+
checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
32+
2733
[[package]]
2834
name = "autocfg"
2935
version = "1.1.0"
@@ -36,6 +42,12 @@ version = "1.3.2"
3642
source = "registry+https://github.com/rust-lang/crates.io-index"
3743
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
3844

45+
[[package]]
46+
name = "bumpalo"
47+
version = "3.11.0"
48+
source = "registry+https://github.com/rust-lang/crates.io-index"
49+
checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d"
50+
3951
[[package]]
4052
name = "byteorder"
4153
version = "1.4.3"
@@ -50,19 +62,21 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
5062

5163
[[package]]
5264
name = "cranelift-bforest"
53-
version = "0.87.0"
65+
version = "0.88.1"
5466
source = "registry+https://github.com/rust-lang/crates.io-index"
55-
checksum = "93945adbccc8d731503d3038814a51e8317497c9e205411820348132fa01a358"
67+
checksum = "44409ccf2d0f663920cab563d2b79fcd6b2e9a2bcc6e929fef76c8f82ad6c17a"
5668
dependencies = [
5769
"cranelift-entity",
5870
]
5971

6072
[[package]]
6173
name = "cranelift-codegen"
62-
version = "0.87.0"
74+
version = "0.88.1"
6375
source = "registry+https://github.com/rust-lang/crates.io-index"
64-
checksum = "2b482acc9d0d0d1ad3288a90a8150ee648be3dce8dc8c8669ff026f72debdc31"
76+
checksum = "98de2018ad96eb97f621f7d6b900a0cc661aec8d02ea4a50e56ecb48e5a2fcaf"
6577
dependencies = [
78+
"arrayvec",
79+
"bumpalo",
6680
"cranelift-bforest",
6781
"cranelift-codegen-meta",
6882
"cranelift-codegen-shared",
@@ -77,30 +91,30 @@ dependencies = [
7791

7892
[[package]]
7993
name = "cranelift-codegen-meta"
80-
version = "0.87.0"
94+
version = "0.88.1"
8195
source = "registry+https://github.com/rust-lang/crates.io-index"
82-
checksum = "f9ec188d71e663192ef9048f204e410a7283b609942efc9fcc77da6d496edbb8"
96+
checksum = "5287ce36e6c4758fbaf298bd1a8697ad97a4f2375a3d1b61142ea538db4877e5"
8397
dependencies = [
8498
"cranelift-codegen-shared",
8599
]
86100

87101
[[package]]
88102
name = "cranelift-codegen-shared"
89-
version = "0.87.0"
103+
version = "0.88.1"
90104
source = "registry+https://github.com/rust-lang/crates.io-index"
91-
checksum = "3ad794b1b1c2c7bd9f7b76cfe0f084eaf7753e55d56191c3f7d89e8fa4978b99"
105+
checksum = "2855c24219e2f08827f3f4ffb2da92e134ae8d8ecc185b11ec8f9878cf5f588e"
92106

93107
[[package]]
94108
name = "cranelift-entity"
95-
version = "0.87.0"
109+
version = "0.88.1"
96110
source = "registry+https://github.com/rust-lang/crates.io-index"
97-
checksum = "342da0d5056f4119d3c311c4aab2460ceb6ee6e127bb395b76dd2279a09ea7a5"
111+
checksum = "0b65673279d75d34bf11af9660ae2dbd1c22e6d28f163f5c72f4e1dc56d56103"
98112

99113
[[package]]
100114
name = "cranelift-frontend"
101-
version = "0.87.0"
115+
version = "0.88.1"
102116
source = "registry+https://github.com/rust-lang/crates.io-index"
103-
checksum = "dfff792f775b07d4d9cfe9f1c767ce755c6cbadda1bbd6db18a1c75ff9f7376a"
117+
checksum = "3ed2b3d7a4751163f6c4a349205ab1b7d9c00eecf19dcea48592ef1f7688eefc"
104118
dependencies = [
105119
"cranelift-codegen",
106120
"log",
@@ -110,15 +124,15 @@ dependencies = [
110124

111125
[[package]]
112126
name = "cranelift-isle"
113-
version = "0.87.0"
127+
version = "0.88.1"
114128
source = "registry+https://github.com/rust-lang/crates.io-index"
115-
checksum = "8d51089478849f2ac8ef60a8a2d5346c8d4abfec0e45ac5b24530ef9f9499e1e"
129+
checksum = "3be64cecea9d90105fc6a2ba2d003e98c867c1d6c4c86cc878f97ad9fb916293"
116130

117131
[[package]]
118132
name = "cranelift-jit"
119-
version = "0.87.0"
133+
version = "0.88.1"
120134
source = "registry+https://github.com/rust-lang/crates.io-index"
121-
checksum = "095936e41720f86004b4c57ce88e6a13af28646bb3a6fb4afbebd5ae90c50029"
135+
checksum = "f98ed42a70a0c9c388e34ec9477f57fc7300f541b1e5136a0e2ea02b1fac6015"
122136
dependencies = [
123137
"anyhow",
124138
"cranelift-codegen",
@@ -134,19 +148,19 @@ dependencies = [
134148

135149
[[package]]
136150
name = "cranelift-module"
137-
version = "0.87.0"
151+
version = "0.88.1"
138152
source = "registry+https://github.com/rust-lang/crates.io-index"
139-
checksum = "704a1aea4723d97eafe0fb7af110f6f6868b1ac95f5380bbc9adb2a3b8cf97e8"
153+
checksum = "d658ac7f156708bfccb647216cc8b9387469f50d352ba4ad80150541e4ae2d49"
140154
dependencies = [
141155
"anyhow",
142156
"cranelift-codegen",
143157
]
144158

145159
[[package]]
146160
name = "cranelift-native"
147-
version = "0.87.0"
161+
version = "0.88.1"
148162
source = "registry+https://github.com/rust-lang/crates.io-index"
149-
checksum = "885debe62f2078638d6585f54c9f05f5c2008f22ce5a2a9100ada785fc065dbd"
163+
checksum = "c4a03a6ac1b063e416ca4b93f6247978c991475e8271465340caa6f92f3c16a4"
150164
dependencies = [
151165
"cranelift-codegen",
152166
"libc",
@@ -155,9 +169,9 @@ dependencies = [
155169

156170
[[package]]
157171
name = "cranelift-object"
158-
version = "0.87.0"
172+
version = "0.88.1"
159173
source = "registry+https://github.com/rust-lang/crates.io-index"
160-
checksum = "aac1310cf1081ae8eca916c92cd163b977c77cab6e831fa812273c26ff921816"
174+
checksum = "eef0b4119b645b870a43a036d76c0ada3a076b1f82e8b8487659304c8b09049b"
161175
dependencies = [
162176
"anyhow",
163177
"cranelift-codegen",
@@ -232,9 +246,9 @@ checksum = "505e71a4706fa491e9b1b55f51b95d4037d0821ee40131190475f692b35b009b"
232246

233247
[[package]]
234248
name = "libloading"
235-
version = "0.6.7"
249+
version = "0.7.3"
236250
source = "registry+https://github.com/rust-lang/crates.io-index"
237-
checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883"
251+
checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd"
238252
dependencies = [
239253
"cfg-if",
240254
"winapi",

compiler/rustc_codegen_cranelift/Cargo.toml

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

99
[dependencies]
1010
# These have to be in sync with each other
11-
cranelift-codegen = { version = "0.87.0", features = ["unwind", "all-arch"] }
12-
cranelift-frontend = "0.87.0"
13-
cranelift-module = "0.87.0"
14-
cranelift-native = "0.87.0"
15-
cranelift-jit = { version = "0.87.0", optional = true }
16-
cranelift-object = "0.87.0"
11+
cranelift-codegen = { version = "0.88.1", features = ["unwind", "all-arch"] }
12+
cranelift-frontend = "0.88.1"
13+
cranelift-module = "0.88.1"
14+
cranelift-native = "0.88.1"
15+
cranelift-jit = { version = "0.88.1", optional = true }
16+
cranelift-object = "0.88.1"
1717
target-lexicon = "0.12.0"
1818
gimli = { version = "0.26.0", default-features = false, features = ["write"]}
1919
object = { version = "0.29.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.9.1"
23-
libloading = { version = "0.6.0", optional = true }
23+
libloading = { version = "0.7.3", optional = true }
2424
once_cell = "1.10.0"
2525
smallvec = "1.8.1"
2626

0 commit comments

Comments
 (0)