Skip to content

Commit 86c8f07

Browse files
committed
CI: Integrate macOS/arm64
Specify using gcc-14 instead of gcc (which typically points to the latest version of gcc) due to a macOS limitation in the rlalik/setup-cpp-compiler@master action. According to [1], each gcc must have specified version. Softfloat build warning error using gcc-14 with optimization flag O1: In file included from src/softfloat/source/include/internals.h:42, from src/softfloat/source/s_mulAddF64.c:40: In function 'softfloat_sub128', inlined from 'softfloat_mulAddF64' at src/softfloat/source/s_mulAddF64.c:185:17: src/softfloat/source/include/primitives.h:526:17: error: 'sig128C.v64' may be used uninitialized [-Werror=maybe-uninitialized] 526 | z.v64 = a64 - b64; | ~~~~^~~~~ src/softfloat/source/s_mulAddF64.c: In function 'softfloat_mulAddF64': src/softfloat/source/s_mulAddF64.c:66:20: note: 'sig128C.v64' was declared here 66 | struct uint128 sig128C; | ^~~~~~~ In function 'softfloat_sub128', inlined from 'softfloat_mulAddF64' at src/softfloat/source/s_mulAddF64.c:185:17: src/softfloat/source/include/primitives.h:527:18: error: 'sig128C.v0' may be used uninitialized [-Werror=maybe-uninitialized] 527 | z.v64 -= (a0 < b0); | ~~~~^~~~~ src/softfloat/source/s_mulAddF64.c: In function 'softfloat_mulAddF64': src/softfloat/source/s_mulAddF64.c:66:20: note: 'sig128C.v0' was declared here 66 | struct uint128 sig128C; Add -Wno-initialized to surpress them. Drop the undefined behavior test on macOS/arm64 using gcc-14, as its libsanitizer's configure.txt does not yet support it, check [2]. [1] https://github.com/rlalik/setup-cpp-compiler [2] https://github.com/iains/gcc-darwin-arm64/blob/master-wip-apple-si/ libsanitizer/configure.tgt Close #519
1 parent 0a375e7 commit 86c8f07

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed

.github/workflows/main.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,118 @@ jobs:
286286
make ENABLE_JIT=1 clean && make ENABLE_EXT_A=0 ENABLE_JIT=1 check -j$(nproc)
287287
make ENABLE_JIT=1 clean && make ENABLE_EXT_F=0 ENABLE_JIT=1 check -j$(nproc)
288288
make ENABLE_JIT=1 clean && make ENABLE_EXT_C=0 ENABLE_JIT=1 check -j$(nproc)
289+
.ci/riscv-toolchain-install.sh && export PATH=$PWD/toolchain/bin:$PATH
290+
python3 -m venv venv
291+
. venv/bin/activate
292+
.ci/riscv-tests.sh
293+
294+
macOS-arm64:
295+
needs: [detect-code-related-file-changes]
296+
if: needs.detect-code-related-file-changes.outputs.has_code_related_changes == 'true'
297+
strategy:
298+
fail-fast: false
299+
matrix:
300+
compiler: [gcc-14, clang]
301+
runs-on: macos-latest # M1 chip
302+
steps:
303+
- uses: actions/checkout@v4
304+
- name: install-dependencies
305+
run: |
306+
brew install make dtc expect sdl2 sdl2_mixer bc e2fsprogs p7zip llvm@18 dcfldd
307+
.ci/riscv-toolchain-install.sh
308+
echo "${{ github.workspace }}/toolchain/bin" >> $GITHUB_PATH
309+
- name: Install compiler
310+
id: install_cc
311+
uses: rlalik/setup-cpp-compiler@master
312+
with:
313+
compiler: ${{ matrix.compiler }}
314+
- name: Symlink gcc-14 due to the default /usr/local/bin/gcc links to system's clang
315+
run: |
316+
ln -s /opt/homebrew/opt/gcc/bin/gcc-14 /usr/local/bin/gcc-14
317+
- name: fetch artifact first to reduce HTTP requests
318+
env:
319+
CC: ${{ steps.install_cc.outputs.cc }}
320+
run: |
321+
make artifact
322+
make ENABLE_SYSTEM=1 artifact
323+
make ENABLE_ARCH_TEST=1 artifact
324+
if: ${{ always() }}
325+
- name: check + tests
326+
env:
327+
CC: ${{ steps.install_cc.outputs.cc }}
328+
run: |
329+
make distclean
330+
make check -j$(sysctl -n hw.logicalcpu)
331+
make tests -j$(sysctl -n hw.logicalcpu)
332+
make misalign -j$(sysctl -n hw.logicalcpu)
333+
make tool -j$(sysctl -n hw.logicalcpu)
334+
if: ${{ always() }}
335+
- name: diverse configurations
336+
env:
337+
CC: ${{ steps.install_cc.outputs.cc }}
338+
run: |
339+
make distclean && make ENABLE_EXT_M=0 check -j$(sysctl -n hw.logicalcpu)
340+
make distclean && make ENABLE_EXT_A=0 check -j$(sysctl -n hw.logicalcpu)
341+
make distclean && make ENABLE_EXT_F=0 check -j$(sysctl -n hw.logicalcpu)
342+
make distclean && make ENABLE_EXT_C=0 check -j$(sysctl -n hw.logicalcpu)
343+
make distclean && make ENABLE_SDL=0 check -j$(sysctl -n hw.logicalcpu)
344+
make distclean && make ENABLE_Zicsr=0 check -j$(sysctl -n hw.logicalcpu)
345+
make distclean && make ENABLE_MOP_FUSION=0 check -j$(sysctl -n hw.logicalcpu)
346+
make distclean && make ENABLE_BLOCK_CHAINING=0 check -j$(sysctl -n hw.logicalcpu)
347+
make distclean && make ENABLE_Zba=0 check -j$(sysctl -n hw.logicalcpu)
348+
make distclean && make ENABLE_Zbb=0 check -j$(sysctl -n hw.logicalcpu)
349+
make distclean && make ENABLE_Zbc=0 check -j$(sysctl -n hw.logicalcpu)
350+
make distclean && make ENABLE_Zbs=0 check -j$(sysctl -n hw.logicalcpu)
351+
make distclean && make ENABLE_Zifencei=0 check -j$(sysctl -n hw.logicalcpu)
352+
if: ${{ always() }}
353+
- name: gdbstub test, need RV32 toolchain
354+
env:
355+
CC: ${{ steps.install_cc.outputs.cc }}
356+
run: |
357+
make distclean && make ENABLE_GDBSTUB=1 gdbstub-test -j$(sysctl -n hw.logicalcpu)
358+
if: ${{ always() }}
359+
- name: JIT test
360+
env:
361+
CC: ${{ steps.install_cc.outputs.cc }}
362+
run: |
363+
make ENABLE_JIT=1 clean && make ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
364+
make ENABLE_JIT=1 clean && make ENABLE_EXT_A=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
365+
make ENABLE_JIT=1 clean && make ENABLE_EXT_F=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
366+
make ENABLE_JIT=1 clean && make ENABLE_EXT_C=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
367+
make ENABLE_JIT=1 clean && make ENABLE_EXT_M=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
368+
make ENABLE_JIT=1 clean && make ENABLE_Zba=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
369+
make ENABLE_JIT=1 clean && make ENABLE_Zbb=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
370+
make ENABLE_JIT=1 clean && make ENABLE_Zbc=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
371+
make ENABLE_JIT=1 clean && make ENABLE_Zbs=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
372+
make ENABLE_JIT=1 clean && make ENABLE_Zicsr=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
373+
make ENABLE_JIT=1 clean && make ENABLE_Zifencei=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
374+
make ENABLE_JIT=1 clean && make ENABLE_MOP_FUSION=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
375+
make ENABLE_JIT=1 clean && make ENABLE_BLOCK_CHAINING=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
376+
if: ${{ always() }}
377+
- name: undefined behavior test
378+
env:
379+
CC: ${{ steps.install_cc.outputs.cc }}
380+
if: ${{ env.CC == 'clang' && always() }} # gcc on macOS/arm64 does not support satinizers
381+
run: |
382+
make distclean && make ENABLE_UBSAN=1 check -j$(sysctl -n hw.logicalcpu)
383+
make ENABLE_JIT=1 clean && make ENABLE_JIT=1 ENABLE_UBSAN=1 check -j$(sysctl -n hw.logicalcpu)
384+
- name: boot Linux kernel test
385+
env:
386+
CC: ${{ steps.install_cc.outputs.cc }}
387+
run: |
388+
make distclean && make INITRD_SIZE=32 ENABLE_SYSTEM=1 -j$(sysctl -n hw.logicalcpu) && \
389+
make ENABLE_SYSTEM=1 artifact -j$(sysctl -n hw.logicalcpu)
390+
.ci/boot-linux.sh
391+
make ENABLE_SYSTEM=1 clean
392+
if: ${{ always() }}
393+
- name: Architecture test
394+
env:
395+
CC: ${{ steps.install_cc.outputs.cc }}
396+
run: |
397+
python3 -m venv venv
398+
. venv/bin/activate
399+
.ci/riscv-tests.sh
400+
if: ${{ always() }}
289401

290402
coding-style:
291403
needs: [detect-code-related-file-changes]

mk/softfloat.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CFLAGS_softfloat := \
66
-Wno-unused-variable \
77
-Wno-sign-compare \
88
-Wno-implicit-fallthrough \
9+
-Wno-uninitialized \
910
-I$(SOFTFLOAT_DIR)/RISCV \
1011
-I$(SOFTFLOAT_DIR)/include
1112

0 commit comments

Comments
 (0)