-
Notifications
You must be signed in to change notification settings - Fork 7.4k
cmake: Fix compilation options for kobject_hash*.c #84636
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
cmake: Fix compilation options for kobject_hash*.c #84636
Conversation
8113dd3
to
31d43a6
Compare
9213954
to
eb98dcb
Compare
This may seem similar to #84862 but is not the same. This was an other use of zephyr_get_compiler_options_for_lang_as_string() than the others in teh repo, since this is actually feeding the options back into our own cmake machinery, hence this is best solved by just hitting the raw properties, (which has the added benefits of keeping all SHELL: and such). |
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.
lgtm.
Some small nits observed, but nothing blocking.
2b8eff3
to
888b9c0
Compare
Is it possible to politely ask for input on 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.
Minor nit.
For completeness, I propose to also add the function-sections
and data-sections
symbold, although that's already the default used in Zephyr.
@@ -210,3 +210,9 @@ set_compiler_property(PROPERTY warning_shadow_variables) | |||
|
|||
set_compiler_property(PROPERTY no_builtin -fno-builtin) | |||
set_compiler_property(PROPERTY no_builtin_malloc -fno-builtin-malloc) | |||
|
|||
# Compiler flag for placing functions in their own sections: |
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.
This comment is wrong, cause the no_function_sections
prevents placing functions in their own sections.
# Compiler flag for placing functions in their own sections: | ||
set_compiler_property(PROPERTY no_function_sections "-fno-function-sections") | ||
|
||
# Compiler flag for placing variables in their own sections: |
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.
Same here, remember to take no
into account.
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.
Fixed.
I dont think it is worth adding it since noby is using it. There are many options that dont have this kind of completeness, is there any particular reason why these two deserves it ? |
81e5803
to
d8ddd7c
Compare
Rework how the compilation-options for the gperf generated kobject_hash*.c files are put together to fix problems with SHELL: and cmake-list separators handling. zephyr_get_compile_options_for_lang_as_string() returns the set of options as a cmake generator expression string which is cumbersome to edit. This caused the command line for the IAR toolchain to have broken SHELL: entries, and other some command line entries being postfixed by "gnu". This also adds CMake compiler properties for no_function_sections and no_data_sections options Signed-off-by: Björn Bergman <[email protected]>
d8ddd7c
to
fb4955a
Compare
Some of the others has the completeness in the sense that they are either default used if not specified or indirectly being set by specifying another flag. But it was just a general proposal and thus not blocking for the review. |
I would greatly appreciate further comments (or approvals) on this. This is one of the things that hinders IAR-toolchain together with CONFIG_USERSPACE. |
More review input (and approval) would be greatly appreciated. |
Rework how the compilation-options for the gperf generated kobject_hash*.c files are put together to fix problems with SHELL: and cmake-list separators handling.
zephyr_get_compile_options_for_lang_as_string() returns the set of options as a cmake generator expression string which is cumbersome to edit. This caused the command line for the IAR toolchain to have broken SHELL: entries, and other some command line entries being postfixed by
"gnu".
This also adds CMake compiler properties for no_function_sections and no_data_sections options