Skip to content

Commit 3aedcf0

Browse files
committedMar 29, 2021
Auto merge of #83637 - bjorn3:sync_cg_clif-2021-03-29, r=bjorn3
Sync rustc_codegen_cranelift The main highlight of this sync is support for cross-compiling to Windows using MinGW. Native compilation with MinGW would also work I think, but using the MSVC toolchain is not yet supported as PE TLS is not yet implemented. Another nice improvement is that crate metadata is now loaded using mmap instead of by reading files. This improves compilation time a bit. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2 parents 40334da + 5444b46 commit 3aedcf0

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
 

‎compiler/rustc_codegen_cranelift/.github/workflows/bootstrap_rustc.yml

-44
This file was deleted.

‎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 }}

0 commit comments

Comments
 (0)
Please sign in to comment.