-
Notifications
You must be signed in to change notification settings - Fork 2
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
Optimize Compilation #15
base: devel
Are you sure you want to change the base?
Conversation
601b31d
to
e75301f
Compare
e75301f
to
37d16e0
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.
Left some comments, looks reasonable overall.
@@ -32,6 +32,7 @@ project(chimera-sdk LANGUAGES C ASM) | |||
set(ABI ilp32) | |||
set(ISA_CLUSTER_SNITCH rv32im) | |||
set(ISA_HOST rv32imc) | |||
set(DISASSEMBLE_LIBRARIES CACHE BOOL OFF) |
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'd argue it almost always makes sense to just provide the objdump for all binaries. If you don't need it you won't feel the overhead, if you need it, you don't want to go digging in the make flow.
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.
Disassembling of the libraries is enabled per default. This flag only triggers to also disassemble the static libraries.
|
||
target_link_options(${TEST_NAME} | ||
PUBLIC | ||
-Wl,--print-memory-usage |
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.
--print-memory-usage
is GCC only, irc.
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.
Since release 17.0.1 it is also would also be supported by the LLD linker. However, with the current flow, we use the LD linker for the LLVM and GCC build flow. Hence, I do not see an issue, and it is tested with the current setup, using toolchain_llvm.cmake
.
References:
37d16e0
to
7f199aa
Compare
7f199aa
to
96b4a66
Compare
Changelog
This PR tries to reduce the binary size and improve the debugging functionality of the generated code. One aspect is to separate create function and data sections to allow garbage collection during linking, which significantly reduces the binary size.
Bugs
The separate section works on the object and library level, but somehow the linker merges everything into the
.text
or.data
sections for the final executable and does not keep the individual subsections.Added
Changed
Fixed
ToDo