Skip to content

Commit

Permalink
ci: Fix clang build and Update qemu (#312)
Browse files Browse the repository at this point in the history
* ci: fix Install QEMU in cross build

* ci: use qemu 9

* ci: install qemu use apt

* ci: fix QEMU_EXEC

* ci: fix clang build
  • Loading branch information
inkydragon authored Jan 4, 2025
1 parent c4667ca commit 296a5e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ on:

jobs:
build-cross-qemu:
runs-on: ubuntu-latest
# TODO: We need Ubuntu 24.04 to use newer version of qemu,
# switch to ubuntu-latest when `ubuntu-latest >= 24.04`
runs-on: ubuntu-24.04
name: build-cross-qemu-${{ matrix.config.arch }}
strategy:
fail-fast: false
Expand All @@ -34,26 +36,17 @@ jobs:
TRIPLE: ${{ matrix.config.triple }}
steps:
- uses: actions/checkout@v4
- name: Install QEMU
# this ensure install latest qemu on ubuntu, apt get version is old
env:
QEMU_SRC: "http://archive.ubuntu.com/ubuntu/pool/universe/q/qemu"
QEMU_VER: "qemu-user-static_7\\.2+dfsg-.*_amd64.deb$"
run: |
DEB=`curl -s $QEMU_SRC/ | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 | grep $QEMU_VER | tail -1`
wget $QEMU_SRC/$DEB
sudo dpkg -i $DEB
- name: Install toolchain gcc-${{ matrix.config.triple }}
- name: Install qemu and toolchain gcc-${{ matrix.config.triple }}
run: |
sudo apt update
sudo apt install gcc-$TRIPLE -y
sudo apt install qemu-user qemu-user-binfmt gcc-$TRIPLE -y
- name: Build with ${{ matrix.config.triple }}-gcc
run: make ARCH=$ARCH TOOLPREFIX=$TRIPLE-
- name: Build tests
run: make -C test ARCH=$ARCH TOOLPREFIX=$TRIPLE-
- name: Run Tests
env:
QEMU_EXEC: qemu-${{ matrix.config.arch }}-static
QEMU_EXEC: qemu-${{ matrix.config.arch }}
CROSS_LIB: /usr/${{ matrix.config.triple }}
run: |
$QEMU_EXEC -L . -L $CROSS_LIB/ test/test-float
Expand Down
6 changes: 6 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ USEGCC ?= 0
USECLANG ?= 1
endif

ifneq (,$(findstring CLANG,$(MSYSTEM)))
# In MSYS2
USEGCC = 0
USECLANG = 1
endif

ifeq ($(ARCH),wasm32)
USECLANG = 1
USEGCC = 0
Expand Down

0 comments on commit 296a5e4

Please sign in to comment.