Skip to content

Commit

Permalink
CI: Integrate macOS/arm64
Browse files Browse the repository at this point in the history
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 sysprog21#519
  • Loading branch information
ChinYikMing committed Feb 14, 2025
1 parent 0a375e7 commit 86c8f07
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 0 deletions.
112 changes: 112 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,118 @@ jobs:
make ENABLE_JIT=1 clean && make ENABLE_EXT_A=0 ENABLE_JIT=1 check -j$(nproc)
make ENABLE_JIT=1 clean && make ENABLE_EXT_F=0 ENABLE_JIT=1 check -j$(nproc)
make ENABLE_JIT=1 clean && make ENABLE_EXT_C=0 ENABLE_JIT=1 check -j$(nproc)
.ci/riscv-toolchain-install.sh && export PATH=$PWD/toolchain/bin:$PATH
python3 -m venv venv
. venv/bin/activate
.ci/riscv-tests.sh
macOS-arm64:
needs: [detect-code-related-file-changes]
if: needs.detect-code-related-file-changes.outputs.has_code_related_changes == 'true'
strategy:
fail-fast: false
matrix:
compiler: [gcc-14, clang]
runs-on: macos-latest # M1 chip
steps:
- uses: actions/checkout@v4
- name: install-dependencies
run: |
brew install make dtc expect sdl2 sdl2_mixer bc e2fsprogs p7zip llvm@18 dcfldd
.ci/riscv-toolchain-install.sh
echo "${{ github.workspace }}/toolchain/bin" >> $GITHUB_PATH
- name: Install compiler
id: install_cc
uses: rlalik/setup-cpp-compiler@master
with:
compiler: ${{ matrix.compiler }}
- name: Symlink gcc-14 due to the default /usr/local/bin/gcc links to system's clang
run: |
ln -s /opt/homebrew/opt/gcc/bin/gcc-14 /usr/local/bin/gcc-14
- name: fetch artifact first to reduce HTTP requests
env:
CC: ${{ steps.install_cc.outputs.cc }}
run: |
make artifact
make ENABLE_SYSTEM=1 artifact
make ENABLE_ARCH_TEST=1 artifact
if: ${{ always() }}
- name: check + tests
env:
CC: ${{ steps.install_cc.outputs.cc }}
run: |
make distclean
make check -j$(sysctl -n hw.logicalcpu)
make tests -j$(sysctl -n hw.logicalcpu)
make misalign -j$(sysctl -n hw.logicalcpu)
make tool -j$(sysctl -n hw.logicalcpu)
if: ${{ always() }}
- name: diverse configurations
env:
CC: ${{ steps.install_cc.outputs.cc }}
run: |
make distclean && make ENABLE_EXT_M=0 check -j$(sysctl -n hw.logicalcpu)
make distclean && make ENABLE_EXT_A=0 check -j$(sysctl -n hw.logicalcpu)
make distclean && make ENABLE_EXT_F=0 check -j$(sysctl -n hw.logicalcpu)
make distclean && make ENABLE_EXT_C=0 check -j$(sysctl -n hw.logicalcpu)
make distclean && make ENABLE_SDL=0 check -j$(sysctl -n hw.logicalcpu)
make distclean && make ENABLE_Zicsr=0 check -j$(sysctl -n hw.logicalcpu)
make distclean && make ENABLE_MOP_FUSION=0 check -j$(sysctl -n hw.logicalcpu)
make distclean && make ENABLE_BLOCK_CHAINING=0 check -j$(sysctl -n hw.logicalcpu)
make distclean && make ENABLE_Zba=0 check -j$(sysctl -n hw.logicalcpu)
make distclean && make ENABLE_Zbb=0 check -j$(sysctl -n hw.logicalcpu)
make distclean && make ENABLE_Zbc=0 check -j$(sysctl -n hw.logicalcpu)
make distclean && make ENABLE_Zbs=0 check -j$(sysctl -n hw.logicalcpu)
make distclean && make ENABLE_Zifencei=0 check -j$(sysctl -n hw.logicalcpu)
if: ${{ always() }}
- name: gdbstub test, need RV32 toolchain
env:
CC: ${{ steps.install_cc.outputs.cc }}
run: |
make distclean && make ENABLE_GDBSTUB=1 gdbstub-test -j$(sysctl -n hw.logicalcpu)
if: ${{ always() }}
- name: JIT test
env:
CC: ${{ steps.install_cc.outputs.cc }}
run: |
make ENABLE_JIT=1 clean && make ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
make ENABLE_JIT=1 clean && make ENABLE_EXT_A=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
make ENABLE_JIT=1 clean && make ENABLE_EXT_F=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
make ENABLE_JIT=1 clean && make ENABLE_EXT_C=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
make ENABLE_JIT=1 clean && make ENABLE_EXT_M=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
make ENABLE_JIT=1 clean && make ENABLE_Zba=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
make ENABLE_JIT=1 clean && make ENABLE_Zbb=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
make ENABLE_JIT=1 clean && make ENABLE_Zbc=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
make ENABLE_JIT=1 clean && make ENABLE_Zbs=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
make ENABLE_JIT=1 clean && make ENABLE_Zicsr=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
make ENABLE_JIT=1 clean && make ENABLE_Zifencei=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
make ENABLE_JIT=1 clean && make ENABLE_MOP_FUSION=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
make ENABLE_JIT=1 clean && make ENABLE_BLOCK_CHAINING=0 ENABLE_JIT=1 check -j$(sysctl -n hw.logicalcpu)
if: ${{ always() }}
- name: undefined behavior test
env:
CC: ${{ steps.install_cc.outputs.cc }}
if: ${{ env.CC == 'clang' && always() }} # gcc on macOS/arm64 does not support satinizers
run: |
make distclean && make ENABLE_UBSAN=1 check -j$(sysctl -n hw.logicalcpu)
make ENABLE_JIT=1 clean && make ENABLE_JIT=1 ENABLE_UBSAN=1 check -j$(sysctl -n hw.logicalcpu)
- name: boot Linux kernel test
env:
CC: ${{ steps.install_cc.outputs.cc }}
run: |
make distclean && make INITRD_SIZE=32 ENABLE_SYSTEM=1 -j$(sysctl -n hw.logicalcpu) && \
make ENABLE_SYSTEM=1 artifact -j$(sysctl -n hw.logicalcpu)
.ci/boot-linux.sh
make ENABLE_SYSTEM=1 clean
if: ${{ always() }}
- name: Architecture test
env:
CC: ${{ steps.install_cc.outputs.cc }}
run: |
python3 -m venv venv
. venv/bin/activate
.ci/riscv-tests.sh
if: ${{ always() }}

coding-style:
needs: [detect-code-related-file-changes]
Expand Down
1 change: 1 addition & 0 deletions mk/softfloat.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CFLAGS_softfloat := \
-Wno-unused-variable \
-Wno-sign-compare \
-Wno-implicit-fallthrough \
-Wno-uninitialized \
-I$(SOFTFLOAT_DIR)/RISCV \
-I$(SOFTFLOAT_DIR)/include

Expand Down

0 comments on commit 86c8f07

Please sign in to comment.