-
Notifications
You must be signed in to change notification settings - Fork 6.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
[Backport v1.14-branch] C++: fix builds with non-Zephyr toolchain #18552
Merged
nashif
merged 3 commits into
zephyrproject-rtos:v1.14-branch
from
pabigot:backport/18242
Sep 25, 2019
Merged
[Backport v1.14-branch] C++: fix builds with non-Zephyr toolchain #18552
nashif
merged 3 commits into
zephyrproject-rtos:v1.14-branch
from
pabigot:backport/18242
Sep 25, 2019
Conversation
This file contains 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
pabigot
added
area: Tests
Issues related to a particular existing or missing test
area: C++
labels
Aug 21, 2019
zephyrbot
added
area: C Library
C Standard Library
area: Test Framework
Issues related not to a particular test, but to the framework instead
labels
Aug 21, 2019
All checks are passing now. Review history of this comment for details about previous failed status. |
galak
reviewed
Aug 21, 2019
pabigot
force-pushed
the
backport/18242
branch
from
August 21, 2019 16:48
295b339
to
da70d22
Compare
Consistently place C++ use of extern "C" after all include directives, within the negative branch of _ASMLANGUAGE if used. Background from issue zephyrproject-rtos#17997: Declarations that use C linkage should be placed within extern "C" so the language linkage is correct when the header is included by a C++ compiler. Similarly #include directives should be outside the extern "C" to ensure the language-specific default linkage is applied to any declarations provided by the included header. Backport: c0d3397 See: https://en.cppreference.com/w/cpp/language/language_linkage Signed-off-by: Peter Bigot <[email protected]>
The solution from zephyrproject-rtos#14312 of using -isystem to prioritize the position of the libc directory bypasses the effect of -ffreestanding with respect to libc symbols expected to be present in a non-hosted environment. Further, it breaks C++ with the ARM Embedded toolchain as the system fails to find the right file with #include_next. Use a more fine-grained solution that explicitly includes the underlying newlib header required for <inttypes.h> support before moving on to include the next available one, whether system or non-system. Closes zephyrproject-rtos#17564 Backport: 96c1b05 Signed-off-by: Peter Bigot <[email protected]>
Confirms build (and run) of C++17 applications that make use of STL containers and other features. Backport: aded6a5 Signed-off-by: Peter Bigot <[email protected]>
pabigot
force-pushed
the
backport/18242
branch
from
August 21, 2019 16:51
da70d22
to
13a3f64
Compare
8 tasks
galak
approved these changes
Aug 27, 2019
nashif
approved these changes
Sep 25, 2019
nashif
approved these changes
Sep 25, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: C Library
C Standard Library
area: C++
area: Test Framework
Issues related not to a particular test, but to the framework instead
area: Tests
Issues related to a particular existing or missing test
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.
This backports the change and test case from #18242, which will close #15603 in the original poster's context of 1.14.