|
48 | 48 | remove_packages_one_command: true |
49 | 49 | remove_folders: "/usr/share/swift /usr/share/miniconda /usr/share/az* /usr/local/lib/node_modules /usr/local/share/chromium /usr/local/share/powershell /usr/local/julia /usr/local/aws-cli /usr/local/aws-sam-cli /usr/share/gradle" |
50 | 50 |
|
| 51 | + - name: Install packages |
| 52 | + if: ${{ matrix.arch.cross_target != '' }} |
| 53 | + run: | |
| 54 | + sudo apt-get update |
| 55 | + sudo apt-get install qemu-system qemu-user-static |
| 56 | +
|
51 | 57 | # `rustup show` installs from rust-toolchain.toml |
52 | 58 | - name: Setup rust toolchain |
53 | 59 | run: rustup show |
|
63 | 69 | sudo dpkg --force-overwrite -i package.deb |
64 | 70 | done |
65 | 71 |
|
| 72 | + - name: Download VM artifact |
| 73 | + if: ${{ matrix.arch.cross_target != '' }} |
| 74 | + run: curl -LO https://github.com/cross-cg-gcc-tools/vms/releases/latest/download/debian-${{ matrix.arch.cross_target }}.img |
| 75 | + |
66 | 76 | - name: Download cross-compiling libgccjit.so and move it in libgccjit-libs-dir |
67 | 77 | if: ${{ matrix.arch.cross_target != '' }} |
68 | 78 | run: | |
|
84 | 94 | mkdir -p $dir |
85 | 95 | mv libgccjit-${{ matrix.arch.cross_target }}.so $dir/libgccjit.so |
86 | 96 |
|
| 97 | + - name: Prepare VM |
| 98 | + if: ${{ matrix.arch.cross_target != '' }} |
| 99 | + run: | |
| 100 | + mkdir vm |
| 101 | + sudo mount debian-${{ matrix.arch.cross_target }}.img vm |
| 102 | + sudo cp $(which qemu-${{ matrix.arch.cross_target }}-static) vm/usr/bin/ |
| 103 | +
|
87 | 104 | - name: Patch linux-raw-sys and rustix. |
88 | 105 | if: ${{ matrix.arch.cross_target != '' }} |
89 | 106 | run: | |
@@ -115,15 +132,29 @@ jobs: |
115 | 132 | ./x build --host=${{ matrix.arch.host_target }} --stage 2 --config ../rustc_codegen_gcc/tests/bootstraps/bootstrap.${{ matrix.arch.host_target }}.toml |
116 | 133 |
|
117 | 134 | - name: Link toolchain |
| 135 | + if: ${{ matrix.arch.cross_target == '' }} |
118 | 136 | run: | |
119 | 137 | cd rust |
120 | 138 | rustup toolchain link my-toolchain build/${{ matrix.arch.host_target }}/stage2 |
121 | 139 |
|
122 | 140 | - name: Smoke test |
| 141 | + if: ${{ matrix.arch.cross_target == '' }} |
123 | 142 | run: | |
124 | 143 | rustc +my-toolchain -V > output |
125 | 144 | grep rustc output |
126 | 145 |
|
| 146 | + - name: Copy toolchain in VM |
| 147 | + if: ${{ matrix.arch.cross_target != '' }} |
| 148 | + run: | |
| 149 | + cd rust |
| 150 | + rsync -a --exclude=stage2/lib/rustlib/src --exclude=stage2/lib/rustlib/rustc-src/ build/m68k-unknown-linux-gnu/stage2 vm/home/stage2 |
| 151 | +
|
| 152 | + - name: Smoke test |
| 153 | + if: ${{ matrix.arch.cross_target != '' }} |
| 154 | + run: | |
| 155 | + sudo chroot vm qemu-m68k-static /home/stage2/rustc > output |
| 156 | + grep rustc output |
| 157 | +
|
127 | 158 | - name: Compile test program |
128 | 159 | run: | |
129 | 160 | cd rustc_codegen_gcc/tests/hello-world |
|
0 commit comments