-
Notifications
You must be signed in to change notification settings - Fork 3k
Enable target-specific toolchain options hook #3894
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
Conversation
Currently, only post_binary_hook is enabled. This patch enables the reset of the toolchain hooks. This is in preparation for target-specific option hook. While at it, clean up the naming of the hooks and supporting functions to make it consistent and scriptable. Signed-off-by: Tony Wu <[email protected]>
Some target, e.g. REALTEK_RTL8195AM, requires special compiler and linker options. This patch adds a target-specific options hook so that target can set those options through target's json and python files. Signed-off-by: Tony Wu <[email protected]>
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.
What does a post-target hook mean?
Also, See #3875. Hooks in python make exporting very hard. I am hesitant to merge another one. |
Initially, I named it post_init_hook, it's hooked after toolchain's initialized. Target-specific options can be added in that hook, instead of in global toolchain files. Maybe post_init_hook is a better name ? |
Sure, |
This is for RTL8195AM board, which requires -fno-short-enum for gcc, and similar option for armcc and iar. Without this patch, these target-specific options have to added to global toolchain files. Or is there a way to do that under current framework ? |
There is no way to do this under the current framework. That is intentional. We don't want there to be any difference between the compiler flags per platform, as that would make writing the general purpose library part of mbed-os very difficult to do correctly and with a small footprint. Why do you need |
It's explained in #3758 |
Replacing 'typedef enum' with enum + explicit typedef works fine for RTL8195AM. This PR is not needed anymore if toolchain hook is not desired. Thanks. |
Thanks for the update and resolving the issue with enum sizes ! @theotherjimmy will have a look at this extension. Edit: already did above. |
@theotherjimmy We dont allow targets to change toolchains behaviour. We can close this one? |
Yes. Closing now. |
Description
Enable target-specific toolchain options hook
Some target, e.g. REALTEK_RTL8195AM, requires special compiler/linker options. Without target-specific options hook, these options have to be added in global files. This PR includes two commits:
Status
READY
Migrations
NO
Related PRs
#3758
Todos
Deploy notes
NO
Steps to test or reproduce
Outline the steps to test or reproduce the PR here.