-
Notifications
You must be signed in to change notification settings - Fork 7k
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
toolchain: make toochain include path available to zephyr #8944
Conversation
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.
Looks definitely like an oversight when we were overwriting TOOLCHAIN_INCLUDES
Codecov Report
@@ Coverage Diff @@
## master #8944 +/- ##
=======================================
Coverage 53.23% 53.23%
=======================================
Files 210 210
Lines 25800 25800
Branches 5677 5677
=======================================
Hits 13735 13735
Misses 9755 9755
Partials 2310 2310 Continue to review full report at Codecov.
|
That one failure we get is exactly the problem we have where things work with one toolchain and not the other because of the header confusion. |
So I'm not sure this makes sense. We should be using the headers associated with the libc we are using. So if we are building with newlib we'd use those, if we are building with minimal libc we should grab those headers. It seems with this change we are mixing the two. |
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 change doesn't seem right. We are mixing headers from two different libc which seems like just subject to problems.
We should be using the headers that come with the toolchain. Now the implementation of the libc (minimal lib or anything else) whether it is the one in the toolchain or a local one is a different story. This is how toolchains (other than the one we have in the zephyr sdk) are configured.
Most of the headers we have as part minimal libc should be removed, we have been adding empty files and duplication of headers due to this bug. |
btw, try building samples/subsys/ipc/openamp with gccarmemb, it will fail because the arm toolchain even with minimal libc enabled does provide the headers of the libc built with the toolchain, i.e. newlib. This all sounds and looks wrong, but we have been adding ad-hoc headers to support features, for example posix APIs (in include/posix), empty headers such as lib/libc/minimal/include/sys/cdefs.h and incomplete headers in other places. |
Agree, this seems really wrong. What happens if you configure gcc w/o newlib? Do you still get a set of C headers? |
There are a few headers that come from gcc, without newlib being built, you will have among others:
with newlib, you will get all the newlib headers obviously. |
b356387
to
ee1fc21
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.
Nothing against from my side.
arch/posix/include/posix_cheats.h
Outdated
@@ -25,7 +25,6 @@ | |||
|
|||
#ifdef CONFIG_PTHREAD_IPC | |||
|
|||
#define timespec zap_timespec |
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.
Why did you chose to remove this one? (it should work both with and without it)
The include path is not available to Zephyr by default, this is contrary to any other toolchain we use. For example unistd.h and friends are available to Zephyr when building using xtools or embedded arm toolchain, but not with the Zephyr SDK. This has been forcing us to carry our own headers in the minimal c library. Signed-off-by: Anas Nashif <[email protected]>
Remove headers that are available through toolchain and integrated libc. Signed-off-by: Anas Nashif <[email protected]>
board_output_number expects u32_t Signed-off-by: Anas Nashif <[email protected]>
Fix int type causing issues when built with newlib headers. Signed-off-by: Anas Nashif <[email protected]>
Fix printf specifiers with newlib. Signed-off-by: Anas Nashif <[email protected]>
ee1fc21
to
967bd01
Compare
will be resolved with sdk-ng |
The include path is not available to Zephyr by default, this is contrary
to any other toolchain we use. For example unistd.h and friends are
available to Zephyr when building using xtools or embedded arm
toolchain, but not with the Zephyr SDK. This has been forcing us to
carry our own headers in the minimal c library.
Signed-off-by: Anas Nashif [email protected]