-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: Integrate macOS/arm64 #569
base: master
Are you sure you want to change the base?
Conversation
Code Review Agent Run #288b18Actionable Suggestions - 0Review Details
|
Quote from the issue. The idea is similar to 7af92d2. |
The JIT test fails as mention in the issue. So that this changes can be postponed to be merged until the JIT warning error is handled. See CI. |
Changelist by BitoThis pull request implements the following key changes.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmarks
Benchmark suite | Current: ad16cd8 | Previous: f6af403 | Ratio |
---|---|---|---|
Dhrystone |
1239 Average DMIPS over 10 runs |
1331 Average DMIPS over 10 runs |
1.07 |
Coremark |
937.092 Average iterations/sec over 10 runs |
946.757 Average iterations/sec over 10 runs |
1.01 |
This comment was automatically generated by workflow using github-action-benchmark.
The macOS host CI completes in approximately 25 minutes, exceeding the Linux host by 7 minutes but still noticeably faster than Linux/arm64. This seems acceptable for adopting the macOS host CI. |
strategy: | ||
fail-fast: false | ||
matrix: | ||
compiler: [gcc-14, clang] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if it makes sense to validate gcc-14 builds on macOS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if it makes sense to validate gcc-14 builds on macOS.
gcc is still available via brew install gcc
(specifically as gcc-14, the latest version). Embracing gcc builds in CI on macOS could benefit gcc enthusiasts? Additionally, building with gcc on macOS uncovered some potential build errors or warnings, which have been addressed in these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the use of gcc. Let's skip the tests on different optimization flags since we already check the general optimizations on Ubuntu Linux prior to macOS builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the use of gcc. Let's skip the tests on different optimization flags since we already check the general optimizations on Ubuntu Linux prior to macOS builds.
But, the softfloat warning is revealed with gcc-14
+ O1 flag on macOS, see the commit message of 1d497b1. Shall we keep them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, the softfloat warning is revealed with
gcc-14
+ O1 flag on macOS, see the commit message of 1d497b1. Shall we keep them?
The default CFLAGS
includes -O2
, and it should be sufficient to make the compilation optimization issues verbose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, the softfloat warning is revealed with
gcc-14
+ O1 flag on macOS, see the commit message of 1d497b1. Shall we keep them?The default
CFLAGS
includes-O2
, and it should be sufficient to make the compilation optimization issues verbose.
Got it, but I will remain the '-Wno-uninitialized' CFLAGS for softfloat.
7af92d2
to
60e6807
Compare
Code Review Agent Run Status
|
60e6807
to
7a032db
Compare
Code Review Agent Run Status
|
7a032db
to
2d9f2f1
Compare
Code Review Agent Run Status
|
8172b84
to
cd7c0e1
Compare
Code Review Agent Run Status
|
cd7c0e1
to
1482689
Compare
Code Review Agent Run Status
|
TODO: add emcc build in CI. #576 Edit: done. |
1482689
to
4d27818
Compare
Code Review Agent Run Status
|
4d27818
to
295097a
Compare
Code Review Agent Run Status
|
295097a
to
eccf1a4
Compare
Code Review Agent Run Status
|
eccf1a4
to
da51ade
Compare
Code Review Agent Run Status
|
One remaining issue to be fixed is that fetching failure of the latest release tag of rv32emu-prebuilt. on macOS/arm64, the failure can be happened very often. The commit da51ade eliminates calling the Github API then avoid the issue. Trying to investigate the root cause. |
Error: Undefined symbols for architecture arm64: "_ebreak_handler", referenced from: lC0 in riscv.o "_ecall_handler", referenced from: lC0 in riscv.o "_log_impl", referenced from: _rv_create in riscv.o _rv_create in riscv.o _rv_create in riscv.o _rv_profile in riscv.o _rv_profile in riscv.o _rv_run in riscv.o "_log_level_string", referenced from: _rv_create in riscv.o "_log_set_level", referenced from: _rv_create in riscv.o "_log_set_stdout_stream", referenced from: _rv_remap_stdstream in riscv.o "_memcpy_handler", referenced from: lC0 in riscv.o "_memory_delete", referenced from: _rv_delete in riscv.o _rv_create in riscv.o "_memory_ifetch", referenced from: _on_mem_ifetch in riscv.o "_memory_new", referenced from: _rv_create in riscv.o "_memory_read_b", referenced from: _on_mem_read_b in riscv.o "_memory_read_s", referenced from: _on_mem_read_s in riscv.o "_memory_read_w", referenced from: _on_mem_read_w in riscv.o "_memory_write_b", referenced from: _on_mem_write_b in riscv.o "_memory_write_s", referenced from: _on_mem_write_s in riscv.o "_memory_write_w", referenced from: _on_mem_write_w in riscv.o "_memset_handler", referenced from: lC0 in riscv.o "_rv", referenced from: _rv_async_block_clear in riscv.o "_rv_step", referenced from: _rv_run in riscv.o _rv_run in riscv.o "_trap_handler", referenced from: lC0 in riscv.o ld: symbol(s) not found for architecture arm64 collect2: error: ld returned 1 exit status make: *** [build/rv_histogram] Error 1 Add emulate.o, syscall.o, syscall_sdl.o, io.o, and log.o objects and conditional build rv_async_block_clear() fixes the error and passes the build.
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
unused function 'emit_dataproc_3source' [-Werror,-Wunused-function]
Refer to [1] and [2], leveraging ${{ secrets.GITHUB_TOKEN }} to be authenticated which increases the Github API request rate limit. [1] https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#primary-rate-limit-for-github_token-in-github-actions [2] https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#getting-a-higher-rate-limit
Code Review Agent Run Status
|
Summary by Bito
This PR enhances the CI pipeline support for macOS/arm64 builds by updating build configurations and managing macOS-specific dependencies. Key improvements include restructuring prebuilt artifact handling, implementing conditional compilation guards for RISC-V instructions, and overall optimizations for cross-platform compatibility.Unit tests added: False
Estimated effort to review (1-5, lower is better): 2