-
Notifications
You must be signed in to change notification settings - Fork 7.6k
toolchain: xt-clang: fixes issues when building picolibc from source #90702
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
Merged
dkalowsk
merged 4 commits into
zephyrproject-rtos:main
from
dcpleung:toolchain/xtclang_bs
Jun 11, 2025
Merged
toolchain: xt-clang: fixes issues when building picolibc from source #90702
dkalowsk
merged 4 commits into
zephyrproject-rtos:main
from
dcpleung:toolchain/xtclang_bs
Jun 11, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Since compiler options are unconditionally passed to the script, we may pass arguments that are not recognized. So we change to only parse known arguments. Currently, it only cares about -l, which is related to linking libraries. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Some tests explicitly test for deprecated functions and they override the macro __deprecated to avoid compiler warnings. So, for xcc/xt-clang, only define __deprecated if it has not already been defined. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Xtensa toolchain xt-clang needs similar treatment to xcc in terms of nostdinc and nostdinc_include, so add it to the if block to exclude these by default. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Although xt-clang is based on clang, for some reason, it still lists xcc system include path as the first search path (e.g. for stddef.h), and the clang system include path as last. This creates a big issue when the code starts to use any standards past C89 (since xcc is based on GCC 4.2). We can use compiler property nostdin_include to add -isystem to compiler options. However, some modules (e.g. picolibcs) somehow ignore this. So we also need to forcibly do add_compile_options() to make sure the clang system include path is placed before the xcc system include path. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
|
nashif
approved these changes
Jun 3, 2025
ping? This is blocking internal CI. |
teburd
approved these changes
Jun 9, 2025
@tejlmand please review |
stephanosio
approved these changes
Jun 10, 2025
dkalowsk
approved these changes
Jun 11, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Although xt-clang is based on clang, for some reason, it still lists xcc system include path as the first search path (e.g. for stddef.h), and the clang system include path as last. This creates a big issue when the code starts to use any standards past C89 (since xcc is based on GCC 4.2). We can use compiler property
nostdin_include
to add-isystem
to compiler options. However, some modules (e.g. picolibc) somehow ignore this. So we also need to forcibly doadd_compile_options()
to make sure the clang system include path is placed before the xcc system include path.