Skip to content

Commit c407fae

Browse files
authored
Merge pull request riscv-collab#1264 from patrick-rivos/llvm-ci
Add LLVM to build CI
2 parents ce6d6cc + 45e6d1b commit c407fae

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

.github/workflows/build.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ jobs:
1616
os: [ubuntu-20.04, ubuntu-22.04]
1717
mode: [newlib, linux, musl]
1818
target: [rv32gc-ilp32d, rv64gc-lp64d]
19+
compiler: [gcc, llvm]
1920
exclude:
2021
- mode: musl
2122
target: rv32gc-ilp32d
23+
- mode: newlib
24+
compiler: llvm
25+
- mode: musl
26+
compiler: llvm
2227
steps:
2328
- uses: actions/checkout@v2
2429

@@ -33,13 +38,19 @@ jobs:
3338
- name: build toolchain
3439
run: |
3540
TARGET_TUPLE=($(echo ${{ matrix.target }} | tr "-" "\n"))
36-
./configure --prefix=/opt/riscv --with-arch=${TARGET_TUPLE[0]} --with-abi=${TARGET_TUPLE[1]}
41+
BUILD_TOOLCHAIN="./configure --prefix=/opt/riscv --with-arch=${TARGET_TUPLE[0]} --with-abi=${TARGET_TUPLE[1]}"
42+
if [ "${{ matrix.compiler }}" == "llvm" ]; then # build toolchain with llvm
43+
$BUILD_TOOLCHAIN --enable-llvm --enable-linux
44+
else
45+
$BUILD_TOOLCHAIN
46+
fi
3747
sudo make -j $(nproc) ${{ matrix.mode }}
3848
3949
- name: make report
4050
if: |
4151
matrix.os == 'ubuntu-20.04'
4252
&& (matrix.mode == 'linux' || matrix.mode == 'newlib')
53+
&& matrix.compiler == 'gcc'
4354
run: |
4455
sudo make report-${{ matrix.mode }} -j $(nproc)
4556
@@ -58,7 +69,7 @@ jobs:
5869
*)
5970
MODE="elf";;
6071
esac
61-
echo ::set-output name=TOOLCHAIN_NAME::riscv$BITS-$MODE-${{ matrix.os }}-nightly
72+
echo ::set-output name=TOOLCHAIN_NAME::riscv$BITS-$MODE-${{ matrix.os }}-${{ matrix.compiler }}-nightly
6273
6374
- uses: actions/upload-artifact@v2
6475
with:

.github/workflows/nightly-release.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,17 @@ jobs:
4848
runs-on: ${{ matrix.os }}
4949
strategy:
5050
matrix:
51-
os: [ubuntu-20.04, ubuntu-22.04]
52-
mode: [newlib, linux, musl]
53-
target: [rv32gc-ilp32d, rv64gc-lp64d]
51+
os: [ubuntu-20.04, ubuntu-22.04]
52+
mode: [newlib, linux, musl]
53+
target: [rv32gc-ilp32d, rv64gc-lp64d]
54+
compiler: [gcc, llvm]
5455
exclude:
5556
- mode: musl
5657
target: rv32gc-ilp32d
58+
- mode: newlib
59+
compiler: llvm
60+
- mode: musl
61+
compiler: llvm
5762
steps:
5863
- uses: actions/checkout@v2
5964

@@ -64,18 +69,17 @@ jobs:
6469
6570
- name: install apt dependencies
6671
run: sudo ./.github/setup-apt.sh
67-
72+
6873
- name: build toolchain
6974
run: |
7075
TARGET_TUPLE=($(echo ${{ matrix.target }} | tr "-" "\n"))
7176
BUILD_TOOLCHAIN="./configure --prefix=/opt/riscv --with-arch=${TARGET_TUPLE[0]} --with-abi=${TARGET_TUPLE[1]}"
72-
if [ "${{ matrix.mode }}" == "linux" ]; then # build toolchain with llvm
77+
if [ "${{ matrix.compiler }}" == "llvm" ]; then # build toolchain with llvm
7378
$BUILD_TOOLCHAIN --enable-llvm --enable-linux
74-
sudo make -j $(nproc) all
7579
else
7680
$BUILD_TOOLCHAIN
77-
sudo make -j $(nproc) ${{ matrix.mode }}
7881
fi
82+
sudo make -j $(nproc) ${{ matrix.mode }}
7983
8084
- name: build qemu
8185
if: "${{ matrix.mode }}" == "linux"

0 commit comments

Comments
 (0)