-
Notifications
You must be signed in to change notification settings - Fork 107
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: Build check with various optimization levels #546
base: master
Are you sure you want to change the base?
Conversation
See action for more information. Clang has no problem with various optimization build. Interesting. |
This is not the right way to fix it. The issue could happen because I only compile the object that I think we need, but maybe more objects are required for Can you check if you can also fix this with the following change? --- a/mk/system.mk
+++ b/mk/system.mk
@@ -28,7 +28,7 @@ DEV_OBJS := $(patsubst $(DEV_SRC)/%.c, $(DEV_OUT)/%.o, $(wildcard $(DEV_SRC)/*.c
deps := $(DEV_OBJS:%.o=%.o.d)
OBJS_EXT += system.o
-OBJS_EXT += dtc/libfdt/fdt.o dtc/libfdt/fdt_ro.o dtc/libfdt/fdt_rw.o
+OBJS_EXT += dtc/libfdt/fdt.o dtc/libfdt/fdt_ro.o dtc/libfdt/fdt_rw.o dtc/libfdt/fdt_wip.o |
Oh sorry, not aware that you are just trying to robust the CI/CD here instead of fixing anything. We can accept the test first and fix it in another PR. |
CC: ${{ steps.install_cc.outputs.cc }} | ||
run: | | ||
make distclean | ||
make OPT_LEVEL=-Ofast ENABLE_SYSTEM=1 -j$(nproc) |
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.
Not sure if we need to take care of -Os
or even just retain the presentative -O level only, otherwise the possible options may be too many. Will let @jserv decide this.
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.
One more -Oz
can be the candidate. It is related to size just like -Os
. Thus, not embracing them at first.
Agree. Thanks! Since with default |
Tested it out, fixed it! Another commit will be push later. |
@RinHizakura One more thing, I noticed the |
Link-Time Optimization (LTO) may be the culprit when building with |
Without modifying the lto configuration, adding this object |
I think we don't need to introduce such complications because building dtc may require other dependencies. |
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.
Rebase the latest master
branch to resolve Arm64 host breakage on CI.
139af81
to
1a2bcc9
Compare
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: 1a2bcc9 | Previous: 64ea138 | Ratio |
---|---|---|---|
Dhrystone |
1313 Average DMIPS over 10 runs |
1324 Average DMIPS over 10 runs |
1.01 |
Coremark |
962.001 Average iterations/sec over 10 runs |
969.943 Average iterations/sec over 10 runs |
1.01 |
This comment was automatically generated by workflow using github-action-benchmark.
The submodules are built locally, which may lead to build failures. Specifically, the dtc submodule fails to build when using GCC versions 11.4.0 or 12.3.0 with optimization levels set to -O0 or with debug flag -g. This is a critical issue, as it can disable the debug mode. To address this, optimization levels and debug level build are introduced to stabilize the pull request changes. The compiled error: /usr/bin/ld: /tmp/cc2eaHdM.ltrans0.ltrans.o: in function fdt_del_node': <artificial>:(.text+0x279f0): undefined reference to fdt_node_end_offset_' collect2: error: ld returned 1 exit status Note: I have only used gcc 11.4.0 and gcc 12.3.0 to test this out. Github runners should test other compilers. After bisecting, the original cause was found after sysprog21#534.
The build error: /usr/bin/ld: /tmp/cc2eaHdM.ltrans0.ltrans.o: in function fdt_del_node': <artificial>:(.text+0x279f0): undefined reference to fdt_node_end_offset_' collect2: error: ld returned 1 exit status
1a2bcc9
to
0ffcdf6
Compare
The submodules are built locally, which may lead to build failures. Specifically, the dtc submodule fails to build when using GCC versions 11.4.0 or 12.3.0 with optimization levels set to -O0 or with debug flag -g. This is a critical issue, as it can disable the debug mode. To address this, optimization levels and debug level build are introduced to stabilize the pull request changes.
The compiled error:
/usr/bin/ld: /tmp/cc2eaHdM.ltrans0.ltrans.o: in function fdt_del_node': :(.text+0x279f0): undefined reference to fdt_node_end_offset_' collect2: error: ld returned 1 exit status
Note: I have only used gcc 11.4.0 and gcc 12.3.0 to test this out. Github runners should test other compilers.
After bisecting, the original cause was found after #534.