Skip to content

Commit 5444b46

Browse files
committed
Merge commit '0969bc6dde001e01e7e1f58c8ccd7750f8a49ae1' into sync_cg_clif-2021-03-29
2 parents cc41030 + 0969bc6 commit 5444b46

Some content is hidden

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

49 files changed

+878
-493
lines changed

Diff for: compiler/rustc_codegen_cranelift/.github/workflows/bootstrap_rustc.yml

-44
This file was deleted.

Diff for: compiler/rustc_codegen_cranelift/.github/workflows/main.yml

+20-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@ on:
77
jobs:
88
build:
99
runs-on: ${{ matrix.os }}
10+
timeout-minutes: 60
1011

1112
strategy:
1213
fail-fast: false
1314
matrix:
14-
os: [ubuntu-latest, macos-latest]
15+
include:
16+
- os: ubuntu-latest
17+
- os: macos-latest
18+
# cross-compile from Linux to Windows using mingw
19+
- os: ubuntu-latest
20+
env:
21+
TARGET_TRIPLE: x86_64-pc-windows-gnu
1522

1623
steps:
1724
- uses: actions/checkout@v2
@@ -36,13 +43,21 @@ jobs:
3643
path: target
3744
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
3845

46+
- name: Install MinGW toolchain and wine
47+
if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
48+
run: |
49+
sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
50+
rustup target add x86_64-pc-windows-gnu
51+
3952
- name: Prepare dependencies
4053
run: |
4154
git config --global user.email "user@example.com"
4255
git config --global user.name "User"
4356
./prepare.sh
4457
4558
- name: Test
59+
env:
60+
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
4661
run: |
4762
# Enable backtraces for easier debugging
4863
export RUST_BACKTRACE=1
@@ -51,12 +66,16 @@ jobs:
5166
export COMPILE_RUNS=2
5267
export RUN_RUNS=2
5368
69+
# Enable extra checks
70+
export CG_CLIF_ENABLE_VERIFIER=1
71+
5472
./test.sh
5573
5674
- name: Package prebuilt cg_clif
5775
run: tar cvfJ cg_clif.tar.xz build
5876

5977
- name: Upload prebuilt cg_clif
78+
if: matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
6079
uses: actions/upload-artifact@v2
6180
with:
6281
name: cg_clif-${{ runner.os }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Various rustc tests
2+
3+
on:
4+
- push
5+
6+
jobs:
7+
bootstrap_rustc:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Cache cargo installed crates
14+
uses: actions/cache@v2
15+
with:
16+
path: ~/.cargo/bin
17+
key: ${{ runner.os }}-cargo-installed-crates
18+
19+
- name: Cache cargo registry and index
20+
uses: actions/cache@v2
21+
with:
22+
path: |
23+
~/.cargo/registry
24+
~/.cargo/git
25+
key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
26+
27+
- name: Cache cargo target dir
28+
uses: actions/cache@v2
29+
with:
30+
path: target
31+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
32+
33+
- name: Prepare dependencies
34+
run: |
35+
git config --global user.email "user@example.com"
36+
git config --global user.name "User"
37+
./prepare.sh
38+
39+
- name: Test
40+
run: |
41+
# Enable backtraces for easier debugging
42+
export RUST_BACKTRACE=1
43+
44+
./scripts/test_bootstrap.sh
45+
rustc_test_suite:
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- uses: actions/checkout@v2
50+
51+
- name: Cache cargo installed crates
52+
uses: actions/cache@v2
53+
with:
54+
path: ~/.cargo/bin
55+
key: ${{ runner.os }}-cargo-installed-crates
56+
57+
- name: Cache cargo registry and index
58+
uses: actions/cache@v2
59+
with:
60+
path: |
61+
~/.cargo/registry
62+
~/.cargo/git
63+
key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
64+
65+
- name: Cache cargo target dir
66+
uses: actions/cache@v2
67+
with:
68+
path: target
69+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
70+
71+
- name: Prepare dependencies
72+
run: |
73+
git config --global user.email "user@example.com"
74+
git config --global user.name "User"
75+
./prepare.sh
76+
77+
- name: Test
78+
run: |
79+
# Enable backtraces for easier debugging
80+
export RUST_BACKTRACE=1
81+
82+
./scripts/test_rustc_tests.sh

Diff for: compiler/rustc_codegen_cranelift/.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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", "macro-error"],
44
"rust-analyzer.assist.importMergeBehavior": "last",
5-
"rust-analyzer.cargo.loadOutDirsFromCheck": true,
5+
"rust-analyzer.cargo.runBuildScripts": true,
66
"rust-analyzer.linkedProjects": [
77
"./Cargo.toml",
88
//"./build_sysroot/sysroot_src/src/libstd/Cargo.toml",

Diff for: compiler/rustc_codegen_cranelift/Cargo.lock

+30-20
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
3939

4040
[[package]]
4141
name = "cranelift-bforest"
42-
version = "0.70.0"
43-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
42+
version = "0.72.0"
43+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
4444
dependencies = [
4545
"cranelift-entity",
4646
]
4747

4848
[[package]]
4949
name = "cranelift-codegen"
50-
version = "0.70.0"
51-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
50+
version = "0.72.0"
51+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
5252
dependencies = [
5353
"byteorder",
5454
"cranelift-bforest",
@@ -65,27 +65,27 @@ dependencies = [
6565

6666
[[package]]
6767
name = "cranelift-codegen-meta"
68-
version = "0.70.0"
69-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
68+
version = "0.72.0"
69+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
7070
dependencies = [
7171
"cranelift-codegen-shared",
7272
"cranelift-entity",
7373
]
7474

7575
[[package]]
7676
name = "cranelift-codegen-shared"
77-
version = "0.70.0"
78-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
77+
version = "0.72.0"
78+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
7979

8080
[[package]]
8181
name = "cranelift-entity"
82-
version = "0.70.0"
83-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
82+
version = "0.72.0"
83+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
8484

8585
[[package]]
8686
name = "cranelift-frontend"
87-
version = "0.70.0"
88-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
87+
version = "0.72.0"
88+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
8989
dependencies = [
9090
"cranelift-codegen",
9191
"log",
@@ -95,8 +95,8 @@ dependencies = [
9595

9696
[[package]]
9797
name = "cranelift-jit"
98-
version = "0.70.0"
99-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
98+
version = "0.72.0"
99+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
100100
dependencies = [
101101
"anyhow",
102102
"cranelift-codegen",
@@ -113,8 +113,8 @@ dependencies = [
113113

114114
[[package]]
115115
name = "cranelift-module"
116-
version = "0.70.0"
117-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
116+
version = "0.72.0"
117+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
118118
dependencies = [
119119
"anyhow",
120120
"cranelift-codegen",
@@ -125,17 +125,17 @@ dependencies = [
125125

126126
[[package]]
127127
name = "cranelift-native"
128-
version = "0.70.0"
129-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
128+
version = "0.72.0"
129+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
130130
dependencies = [
131131
"cranelift-codegen",
132132
"target-lexicon",
133133
]
134134

135135
[[package]]
136136
name = "cranelift-object"
137-
version = "0.70.0"
138-
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
137+
version = "0.72.0"
138+
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
139139
dependencies = [
140140
"anyhow",
141141
"cranelift-codegen",
@@ -240,6 +240,15 @@ dependencies = [
240240
"libc",
241241
]
242242

243+
[[package]]
244+
name = "memmap2"
245+
version = "0.2.1"
246+
source = "registry+https://github.com/rust-lang/crates.io-index"
247+
checksum = "04e3e85b970d650e2ae6d70592474087051c11c54da7f7b4949725c5735fbcc6"
248+
dependencies = [
249+
"libc",
250+
]
251+
243252
[[package]]
244253
name = "object"
245254
version = "0.23.0"
@@ -310,6 +319,7 @@ dependencies = [
310319
"gimli",
311320
"indexmap",
312321
"libloading",
322+
"memmap2",
313323
"object",
314324
"smallvec",
315325
"target-lexicon",

Diff for: compiler/rustc_codegen_cranelift/Cargo.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime/", branch
1616
cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime/", branch = "main" }
1717
target-lexicon = "0.11.0"
1818
gimli = { version = "0.23.0", default-features = false, features = ["write"]}
19-
object = { version = "0.23.0", default-features = false, features = ["std", "read_core", "write", "coff", "elf", "macho", "pe"] }
19+
object = { version = "0.23.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"
2323
libloading = { version = "0.6.0", optional = true }
2424
smallvec = "1.6.1"
25+
memmap2 = "0.2.1"
2526

2627
# Uncomment to use local checkout of cranelift
2728
#[patch."https://github.com/bytecodealliance/wasmtime/"]
@@ -75,3 +76,6 @@ debug = false
7576
[profile.release.package.syn]
7677
opt-level = 0
7778
debug = false
79+
80+
[package.metadata.rust-analyzer]
81+
rustc_private = true

0 commit comments

Comments
 (0)