Skip to content

Commit 21d7dce

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 ee841ce commit 21d7dce

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

.github/workflows/main.yml

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

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)