|
17 | 17 | output: [src] # [src, build]
|
18 | 18 | install: [rustup] # [rustup, standalone]
|
19 | 19 | sysroot: [common] # [common, custom]
|
| 20 | + lto: [none] # [none, thin] |
20 | 21 |
|
21 | 22 | exclude:
|
22 | 23 | # arm 32-bit gcc not yet supported
|
|
34 | 35 | # A few independent combinations to avoid exploding the matrix:
|
35 | 36 | # - The other option for `output`.
|
36 | 37 | # - Different releases for `rustc`.
|
| 38 | + # - Explicitly enabling `lto` on platforms which support LTO. |
37 | 39 | # - The other three (`install`, `sysroot`) combinations
|
38 | 40 | # (they are interrelated, so the cross-product needs to be tested)
|
39 | 41 | include:
|
|
44 | 46 | output: build
|
45 | 47 | install: rustup
|
46 | 48 | sysroot: custom
|
| 49 | + lto: none |
| 50 | + |
| 51 | + - arch: arm64 |
| 52 | + toolchain: llvm |
| 53 | + config: debug |
| 54 | + rustc: 1.55.0 |
| 55 | + output: build |
| 56 | + install: rustup |
| 57 | + sysroot: custom |
| 58 | + lto: thin |
| 59 | + |
| 60 | + - arch: arm64 |
| 61 | + toolchain: llvm |
| 62 | + config: release |
| 63 | + rustc: 1.55.0 |
| 64 | + output: build |
| 65 | + install: rustup |
| 66 | + sysroot: custom |
| 67 | + lto: thin |
47 | 68 |
|
48 | 69 | - arch: ppc64le
|
49 | 70 | toolchain: clang
|
|
52 | 73 | output: build
|
53 | 74 | install: standalone
|
54 | 75 | sysroot: common
|
| 76 | + lto: none |
55 | 77 |
|
56 | 78 | - arch: x86_64
|
57 | 79 | toolchain: llvm
|
|
60 | 82 | output: build
|
61 | 83 | install: standalone
|
62 | 84 | sysroot: custom
|
| 85 | + lto: none |
| 86 | + |
| 87 | + - arch: x86_64 |
| 88 | + toolchain: llvm |
| 89 | + config: debug |
| 90 | + rustc: 1.55.0 |
| 91 | + output: src |
| 92 | + install: rustup |
| 93 | + sysroot: common |
| 94 | + lto: thin |
| 95 | + |
| 96 | + - arch: x86_64 |
| 97 | + toolchain: llvm |
| 98 | + config: release |
| 99 | + rustc: 1.55.0 |
| 100 | + output: src |
| 101 | + install: rustup |
| 102 | + sysroot: common |
| 103 | + lto: thin |
63 | 104 |
|
64 | 105 | steps:
|
65 | 106 | # Setup: checkout
|
@@ -124,6 +165,12 @@ jobs:
|
124 | 165 | - if: matrix.toolchain == 'llvm'
|
125 | 166 | run: echo 'MAKE_TOOLCHAIN=LLVM=1' >> $GITHUB_ENV
|
126 | 167 |
|
| 168 | + # if arch is supported and ThinLTO is enabled, enable LLVM's integrated assembler |
| 169 | + - if: matrix.arch == 'arm64' && matrix.toolchain == 'llvm' && matrix.lto == 'thin' |
| 170 | + run: echo 'MAKE_LLVM_IAS=LLVM_IAS=1' >> $GITHUB_ENV |
| 171 | + - if: matrix.arch == 'x86_64' && matrix.toolchain == 'llvm' && matrix.lto == 'thin' |
| 172 | + run: echo 'MAKE_LLVM_IAS=LLVM_IAS=1' >> $GITHUB_ENV |
| 173 | + |
127 | 174 | - if: matrix.output == 'build'
|
128 | 175 | run: |
|
129 | 176 | echo 'MAKE_OUTPUT=O=build' >> $GITHUB_ENV
|
@@ -246,7 +293,10 @@ jobs:
|
246 | 293 | echo 'obj-m += rust_module_parameters_loadable_custom.o' >> samples/rust/Makefile
|
247 | 294 |
|
248 | 295 | # Build
|
249 |
| - - run: mv .github/workflows/kernel-${{ matrix.arch }}-${{ matrix.config }}.config .config |
| 296 | + - if: matrix.lto == 'none' |
| 297 | + run: mv .github/workflows/kernel-${{ matrix.arch }}-${{ matrix.config }}.config .config |
| 298 | + - if: matrix.lto == 'thin' |
| 299 | + run: mv .github/workflows/kernel-${{ matrix.arch }}-${{ matrix.config }}-thinlto.config .config |
250 | 300 |
|
251 | 301 | - if: matrix.output == 'build'
|
252 | 302 | run: |
|
@@ -389,7 +439,7 @@ jobs:
|
389 | 439 | ${{ env.BUILD_DIR }}vmlinux \
|
390 | 440 | ${{ env.BUILD_DIR }}${{ env.IMAGE_PATH }}
|
391 | 441 |
|
392 |
| - size \ |
| 442 | + .github/workflows/size.sh \ |
393 | 443 | ${{ env.BUILD_DIR }}samples/rust/*.o \
|
394 | 444 | ${{ env.BUILD_DIR }}samples/rust/*.ko \
|
395 | 445 | ${{ env.BUILD_DIR }}drivers/android/rust_binder.o \
|
|
0 commit comments