Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync rustc_codegen_cranelift #83637

Merged
merged 60 commits into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
b63df38
Shrink the size of Rvalue by 16 bytes
oli-obk Mar 5, 2021
27886cd
Merge commit '9a0c32934ebe376128230aa8da3275697b2053e7' into sync_cg_…
bjorn3 Mar 5, 2021
09a36b4
Merge branch 'sync_from_rust'
bjorn3 Mar 5, 2021
c825bc8
Update Cranelift
bjorn3 Mar 5, 2021
1122f42
Support cross-compiling to Windows using MinGW
bjorn3 May 25, 2020
d23b12f
Build all tests when cross-compiling
bjorn3 Feb 25, 2021
00f1cdd
Test Windows cross-compilation on CI
bjorn3 Feb 25, 2021
274a7ac
Merge pull request #1145 from bjorn3/mingw_support
bjorn3 Mar 5, 2021
0985044
Use --print file-names instead of a match on uname
bjorn3 Mar 6, 2021
5f3d640
Fix warning
bjorn3 Mar 6, 2021
bd1b1dd
Handle #![windows_subsystem]
bjorn3 Mar 6, 2021
4ca3384
Make it possible to enable the verifier in release mode
bjorn3 Mar 6, 2021
cecd7a9
Add clif comments when in release mode
bjorn3 Mar 6, 2021
d194c70
Use jemalloc
bjorn3 Mar 6, 2021
76bb1f1
Move the more advanced ways to use cg_clif to usage.md
bjorn3 Mar 6, 2021
be3aa06
Revert "Use jemalloc"
bjorn3 Mar 6, 2021
95e4db3
More doc fixes
bjorn3 Mar 6, 2021
0533913
Add license section to the readme
bjorn3 Mar 6, 2021
341a486
Use the new component dependency option of the rust-toolchain file (t…
bjorn3 Nov 27, 2020
7f02020
Auto merge of #82727 - oli-obk:shrinkmem, r=pnkfelix
bors Mar 8, 2021
6ef48e9
Sync from rust 4b9f5cc4c10a161047475cb9bbe02c4fda57fb07
bjorn3 Mar 9, 2021
8f62149
Rustup to rustc 1.52.0-nightly (8f349be27 2021-03-08)
bjorn3 Mar 9, 2021
826189e
Some clippy fixes
bjorn3 Mar 9, 2021
9adb139
Add rustc_private=true to the package metadata for rust-analyzer
bjorn3 Mar 9, 2021
eefe1ed
Update config name for latest rust-analyzer
bjorn3 Mar 9, 2021
8718748
Lower GHA timeout to 60 min
bjorn3 Mar 9, 2021
6b58ed2
Adjust for changed -Zmir-opt-level numbering
bjorn3 Mar 9, 2021
83e6251
Update cranelift
JulianKnodt Dec 29, 2020
d30c497
Build StKind::CopyOverlapping
JulianKnodt Jan 23, 2021
d674d3d
Clean up todos
JulianKnodt Feb 26, 2021
95182bb
rustc_target: add "unwind" payloads to `Abi`
Aug 27, 2020
1b1f6ea
Auto merge of #76570 - cratelyn:implement-rfc-2945-c-unwind-abi, r=Am…
bors Mar 10, 2021
6b1dd82
Prepare mir::Constant for ty::Const only supporting valtrees
oli-obk Mar 8, 2021
578fcde
Special case ZST's in Rvalue::Repeat
bjorn3 Mar 15, 2021
b1d14ca
Use mmap for metadata loading
bjorn3 Mar 15, 2021
21a0c8e
s/ConstantSource/ConstantKind/
oli-obk Mar 15, 2021
3d85f05
Remove no longer necessary intcasts
bjorn3 Mar 15, 2021
78d0b77
Update Cranelift
bjorn3 Mar 15, 2021
f545a21
Split rust fork setup out of test_bootstrap.sh
bjorn3 Mar 15, 2021
afc529d
Fix assert_assignable adt checking
bjorn3 Mar 15, 2021
154668b
Suppress an unnecessary warning and fix an incorrect warning
bjorn3 Mar 15, 2021
80b2fea
Run the rustc test suite on CI
bjorn3 Mar 15, 2021
a47896d
Merge pull request #1149 from bjorn3/test_rustc_testsuite
bjorn3 Mar 15, 2021
53235d2
Enable thread test in std_example
bjorn3 Mar 15, 2021
218b383
Rustfmt
bjorn3 Mar 17, 2021
e86b954
Directly invoke the main function in JIT mode
bjorn3 Mar 17, 2021
6a0ce7f
Sync from rust 04ae50179a802d1d18bb780baa85f55864f56616
bjorn3 Mar 17, 2021
664b25e
Rustup to rustc 1.52.0-nightly (36f1f04f1 2021-03-17)
bjorn3 Mar 18, 2021
0069007
Avoid nightly feature usage where easily possible
bjorn3 Mar 18, 2021
7bd3950
Fix rustc test suite
bjorn3 Mar 18, 2021
e4a1092
Add simd_neg platform intrinsic
SparrowLii Mar 18, 2021
500bcfc
update `const_eval_resolve`
lcnr Mar 13, 2021
56fe51c
Update Cranelift
bjorn3 Mar 21, 2021
73626ef
Rustfmt
bjorn3 Mar 21, 2021
9a21312
Sync from rust 4137088d9da94f693b287f35e2b17782c0b1a283
bjorn3 Mar 26, 2021
7889a32
Rustup to rustc 1.53.0-nightly (52e3dffa5 2021-03-25)
bjorn3 Mar 26, 2021
f3e8f6d
Rustfmt
bjorn3 Mar 26, 2021
94b51d1
Make all compiler-builtins symbols hidden
bjorn3 Mar 27, 2021
0969bc6
Rustup to rustc 1.53.0-nightly (4a20eb6a9 2021-03-28)
bjorn3 Mar 29, 2021
5444b46
Merge commit '0969bc6dde001e01e7e1f58c8ccd7750f8a49ae1' into sync_cg_…
bjorn3 Mar 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

21 changes: 20 additions & 1 deletion compiler/rustc_codegen_cranelift/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ on:
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 60

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
- os: macos-latest
# cross-compile from Linux to Windows using mingw
- os: ubuntu-latest
env:
TARGET_TRIPLE: x86_64-pc-windows-gnu

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

- name: Install MinGW toolchain and wine
if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
run: |
sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
rustup target add x86_64-pc-windows-gnu

- name: Prepare dependencies
run: |
git config --global user.email "[email protected]"
git config --global user.name "User"
./prepare.sh

- name: Test
env:
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
run: |
# Enable backtraces for easier debugging
export RUST_BACKTRACE=1
Expand All @@ -51,12 +66,16 @@ jobs:
export COMPILE_RUNS=2
export RUN_RUNS=2

# Enable extra checks
export CG_CLIF_ENABLE_VERIFIER=1

./test.sh

- name: Package prebuilt cg_clif
run: tar cvfJ cg_clif.tar.xz build

- name: Upload prebuilt cg_clif
if: matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
uses: actions/upload-artifact@v2
with:
name: cg_clif-${{ runner.os }}
Expand Down
82 changes: 82 additions & 0 deletions compiler/rustc_codegen_cranelift/.github/workflows/rustc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Various rustc tests

on:
- push

jobs:
bootstrap_rustc:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache cargo installed crates
uses: actions/cache@v2
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-installed-crates

- name: Cache cargo registry and index
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo target dir
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}

- name: Prepare dependencies
run: |
git config --global user.email "[email protected]"
git config --global user.name "User"
./prepare.sh

- name: Test
run: |
# Enable backtraces for easier debugging
export RUST_BACKTRACE=1

./scripts/test_bootstrap.sh
rustc_test_suite:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache cargo installed crates
uses: actions/cache@v2
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-installed-crates

- name: Cache cargo registry and index
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo target dir
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}

- name: Prepare dependencies
run: |
git config --global user.email "[email protected]"
git config --global user.name "User"
./prepare.sh

- name: Test
run: |
# Enable backtraces for easier debugging
export RUST_BACKTRACE=1

./scripts/test_rustc_tests.sh
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// source for rustc_* is not included in the rust-src component; disable the errors about this
"rust-analyzer.diagnostics.disabled": ["unresolved-extern-crate", "macro-error"],
"rust-analyzer.assist.importMergeBehavior": "last",
"rust-analyzer.cargo.loadOutDirsFromCheck": true,
"rust-analyzer.cargo.runBuildScripts": true,
"rust-analyzer.linkedProjects": [
"./Cargo.toml",
//"./build_sysroot/sysroot_src/src/libstd/Cargo.toml",
Expand Down
50 changes: 30 additions & 20 deletions compiler/rustc_codegen_cranelift/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"

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

[[package]]
name = "cranelift-codegen"
version = "0.70.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [
"byteorder",
"cranelift-bforest",
Expand All @@ -65,27 +65,27 @@ dependencies = [

[[package]]
name = "cranelift-codegen-meta"
version = "0.70.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [
"cranelift-codegen-shared",
"cranelift-entity",
]

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

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

[[package]]
name = "cranelift-frontend"
version = "0.70.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [
"cranelift-codegen",
"log",
Expand All @@ -95,8 +95,8 @@ dependencies = [

[[package]]
name = "cranelift-jit"
version = "0.70.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand All @@ -113,8 +113,8 @@ dependencies = [

[[package]]
name = "cranelift-module"
version = "0.70.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand All @@ -125,17 +125,17 @@ dependencies = [

[[package]]
name = "cranelift-native"
version = "0.70.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [
"cranelift-codegen",
"target-lexicon",
]

[[package]]
name = "cranelift-object"
version = "0.70.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#cdb60ec5a9df087262ae8960a31067e88cd80058"
version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand Down Expand Up @@ -240,6 +240,15 @@ dependencies = [
"libc",
]

[[package]]
name = "memmap2"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04e3e85b970d650e2ae6d70592474087051c11c54da7f7b4949725c5735fbcc6"
dependencies = [
"libc",
]

[[package]]
name = "object"
version = "0.23.0"
Expand Down Expand Up @@ -310,6 +319,7 @@ dependencies = [
"gimli",
"indexmap",
"libloading",
"memmap2",
"object",
"smallvec",
"target-lexicon",
Expand Down
6 changes: 5 additions & 1 deletion compiler/rustc_codegen_cranelift/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime/", branch
cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime/", branch = "main" }
target-lexicon = "0.11.0"
gimli = { version = "0.23.0", default-features = false, features = ["write"]}
object = { version = "0.23.0", default-features = false, features = ["std", "read_core", "write", "coff", "elf", "macho", "pe"] }
object = { version = "0.23.0", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }

ar = { git = "https://github.com/bjorn3/rust-ar.git", branch = "do_not_remove_cg_clif_ranlib" }
indexmap = "1.0.2"
libloading = { version = "0.6.0", optional = true }
smallvec = "1.6.1"
memmap2 = "0.2.1"

# Uncomment to use local checkout of cranelift
#[patch."https://github.com/bytecodealliance/wasmtime/"]
Expand Down Expand Up @@ -75,3 +76,6 @@ debug = false
[profile.release.package.syn]
opt-level = 0
debug = false

[package.metadata.rust-analyzer]
rustc_private = true
Loading