Skip to content

Commit 296a5e4

Browse files
authored
ci: Fix clang build and Update qemu (#312)
* ci: fix Install QEMU in cross build * ci: use qemu 9 * ci: install qemu use apt * ci: fix QEMU_EXEC * ci: fix clang build
1 parent c4667ca commit 296a5e4

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

.github/workflows/cross.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ on:
1111

1212
jobs:
1313
build-cross-qemu:
14-
runs-on: ubuntu-latest
14+
# TODO: We need Ubuntu 24.04 to use newer version of qemu,
15+
# switch to ubuntu-latest when `ubuntu-latest >= 24.04`
16+
runs-on: ubuntu-24.04
1517
name: build-cross-qemu-${{ matrix.config.arch }}
1618
strategy:
1719
fail-fast: false
@@ -34,26 +36,17 @@ jobs:
3436
TRIPLE: ${{ matrix.config.triple }}
3537
steps:
3638
- uses: actions/checkout@v4
37-
- name: Install QEMU
38-
# this ensure install latest qemu on ubuntu, apt get version is old
39-
env:
40-
QEMU_SRC: "http://archive.ubuntu.com/ubuntu/pool/universe/q/qemu"
41-
QEMU_VER: "qemu-user-static_7\\.2+dfsg-.*_amd64.deb$"
42-
run: |
43-
DEB=`curl -s $QEMU_SRC/ | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 | grep $QEMU_VER | tail -1`
44-
wget $QEMU_SRC/$DEB
45-
sudo dpkg -i $DEB
46-
- name: Install toolchain gcc-${{ matrix.config.triple }}
39+
- name: Install qemu and toolchain gcc-${{ matrix.config.triple }}
4740
run: |
4841
sudo apt update
49-
sudo apt install gcc-$TRIPLE -y
42+
sudo apt install qemu-user qemu-user-binfmt gcc-$TRIPLE -y
5043
- name: Build with ${{ matrix.config.triple }}-gcc
5144
run: make ARCH=$ARCH TOOLPREFIX=$TRIPLE-
5245
- name: Build tests
5346
run: make -C test ARCH=$ARCH TOOLPREFIX=$TRIPLE-
5447
- name: Run Tests
5548
env:
56-
QEMU_EXEC: qemu-${{ matrix.config.arch }}-static
49+
QEMU_EXEC: qemu-${{ matrix.config.arch }}
5750
CROSS_LIB: /usr/${{ matrix.config.triple }}
5851
run: |
5952
$QEMU_EXEC -L . -L $CROSS_LIB/ test/test-float

Make.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ USEGCC ?= 0
3737
USECLANG ?= 1
3838
endif
3939

40+
ifneq (,$(findstring CLANG,$(MSYSTEM)))
41+
# In MSYS2
42+
USEGCC = 0
43+
USECLANG = 1
44+
endif
45+
4046
ifeq ($(ARCH),wasm32)
4147
USECLANG = 1
4248
USEGCC = 0

0 commit comments

Comments
 (0)