Skip to content

Commit 9af41fa

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 a40fd0b commit 9af41fa

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

.github/workflows/main.yml

+108
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,114 @@ jobs:
317317
make ENABLE_JIT=1 clean && make ENABLE_EXT_F=0 ENABLE_JIT=1 check -j$(nproc)
318318
make ENABLE_JIT=1 clean && make ENABLE_EXT_C=0 ENABLE_JIT=1 check -j$(nproc)
319319
320+
macOS-arm64:
321+
needs: [detect-code-related-file-changes]
322+
if: needs.detect-code-related-file-changes.outputs.has_code_related_changes == 'true'
323+
strategy:
324+
fail-fast: false
325+
matrix:
326+
compiler: [gcc-14, clang]
327+
runs-on: macos-latest # M1 chip
328+
steps:
329+
- uses: actions/checkout@v4
330+
- name: install-dependencies
331+
run: |
332+
brew install make dtc expect sdl2 sdl2_mixer bc e2fsprogs p7zip llvm@18 dcfldd
333+
.ci/riscv-toolchain-install.sh
334+
echo "${{ github.workspace }}/toolchain/bin" >> $GITHUB_PATH
335+
- name: Install compiler
336+
id: install_cc
337+
uses: rlalik/setup-cpp-compiler@master
338+
with:
339+
compiler: ${{ matrix.compiler }}
340+
- name: Symlink gcc-14 due to the default /usr/local/bin/gcc links to system's clang
341+
run: |
342+
ln -s /opt/homebrew/opt/gcc/bin/gcc-14 /usr/local/bin/gcc-14
343+
- name: fetch artifact first to reduce HTTP requests
344+
env:
345+
CC: ${{ steps.install_cc.outputs.cc }}
346+
run: |
347+
make artifact
348+
make ENABLE_SYSTEM=1 artifact
349+
make ENABLE_ARCH_TEST=1 artifact
350+
if: ${{ always() }}
351+
- name: check + tests
352+
env:
353+
CC: ${{ steps.install_cc.outputs.cc }}
354+
run: |
355+
make distclean
356+
make check -j$(sysctl -n hw.logicalcpu)
357+
make tests -j$(sysctl -n hw.logicalcpu)
358+
make misalign -j$(sysctl -n hw.logicalcpu)
359+
make tool -j$(sysctl -n hw.logicalcpu)
360+
if: ${{ always() }}
361+
- name: diverse configurations
362+
env:
363+
CC: ${{ steps.install_cc.outputs.cc }}
364+
run: |
365+
make distclean && make ENABLE_EXT_M=0 check -j$(sysctl -n hw.logicalcpu)
366+
make distclean && make ENABLE_EXT_A=0 check -j$(sysctl -n hw.logicalcpu)
367+
make distclean && make ENABLE_EXT_F=0 check -j$(sysctl -n hw.logicalcpu)
368+
make distclean && make ENABLE_EXT_C=0 check -j$(sysctl -n hw.logicalcpu)
369+
make distclean && make ENABLE_SDL=0 check -j$(sysctl -n hw.logicalcpu)
370+
make distclean && make ENABLE_Zicsr=0 check -j$(sysctl -n hw.logicalcpu)
371+
make distclean && make ENABLE_MOP_FUSION=0 check -j$(sysctl -n hw.logicalcpu)
372+
make distclean && make ENABLE_BLOCK_CHAINING=0 check -j$(sysctl -n hw.logicalcpu)
373+
make distclean && make ENABLE_Zba=0 check -j$(sysctl -n hw.logicalcpu)
374+
make distclean && make ENABLE_Zbb=0 check -j$(sysctl -n hw.logicalcpu)
375+
make distclean && make ENABLE_Zbc=0 check -j$(sysctl -n hw.logicalcpu)
376+
make distclean && make ENABLE_Zbs=0 check -j$(sysctl -n hw.logicalcpu)
377+
make distclean && make ENABLE_Zifencei=0 check -j$(sysctl -n hw.logicalcpu)
378+
if: ${{ always() }}
379+
- name: gdbstub test, need RV32 toolchain
380+
env:
381+
CC: ${{ steps.install_cc.outputs.cc }}
382+
run: |
383+
make distclean && make ENABLE_GDBSTUB=1 gdbstub-test -j$(sysctl -n hw.logicalcpu)
384+
if: ${{ always() }}
385+
- name: JIT test
386+
env:
387+
CC: ${{ steps.install_cc.outputs.cc }}
388+
run: |
389+
make ENABLE_JIT=1 clean && make ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
390+
make ENABLE_JIT=1 clean && make ENABLE_EXT_A=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
391+
make ENABLE_JIT=1 clean && make ENABLE_EXT_F=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
392+
make ENABLE_JIT=1 clean && make ENABLE_EXT_C=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
393+
make ENABLE_JIT=1 clean && make ENABLE_EXT_M=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
394+
make ENABLE_JIT=1 clean && make ENABLE_Zba=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
395+
make ENABLE_JIT=1 clean && make ENABLE_Zbb=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
396+
make ENABLE_JIT=1 clean && make ENABLE_Zbc=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
397+
make ENABLE_JIT=1 clean && make ENABLE_Zbs=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
398+
make ENABLE_JIT=1 clean && make ENABLE_Zicsr=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
399+
make ENABLE_JIT=1 clean && make ENABLE_Zifencei=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
400+
make ENABLE_JIT=1 clean && make ENABLE_MOP_FUSION=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
401+
make ENABLE_JIT=1 clean && make ENABLE_BLOCK_CHAINING=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
402+
if: ${{ always() }}
403+
- name: undefined behavior test
404+
env:
405+
CC: ${{ steps.install_cc.outputs.cc }}
406+
if: ${{ env.CC == 'clang' && always() }} # gcc on macOS/arm64 does not support satinizers
407+
run: |
408+
make distclean && make ENABLE_UBSAN=1 check -j$(sysctl -n hw.logicalcpu)
409+
make ENABLE_JIT=1 clean && make ENABLE_JIT=1 ENABLE_UBSAN=1 check -j$(sysctl -n hw.logicalcpu)
410+
- name: boot Linux kernel test
411+
env:
412+
CC: ${{ steps.install_cc.outputs.cc }}
413+
run: |
414+
make distclean && make INITRD_SIZE=32 ENABLE_SYSTEM=1 -j$(sysctl -n hw.logicalcpu) && \
415+
make ENABLE_SYSTEM=1 artifact -j$(sysctl -n hw.logicalcpu)
416+
.ci/boot-linux.sh
417+
make ENABLE_SYSTEM=1 clean
418+
if: ${{ always() }}
419+
- name: Architecture test
420+
env:
421+
CC: ${{ steps.install_cc.outputs.cc }}
422+
run: |
423+
python3 -m venv venv
424+
. venv/bin/activate
425+
.ci/riscv-tests.sh
426+
if: ${{ always() }}
427+
320428
coding-style:
321429
needs: [detect-code-related-file-changes]
322430
if: needs.detect-code-related-file-changes.outputs.has_code_related_changes == 'true'

mk/softfloat.mk

+1
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)