-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Build fails for native_posix
board when using C++ <atomic> header
#40023
Comments
@stephanosio - is this a bug or a feature we simply haven't added yet? |
@cfriedt This happens because the Linux libstdc++ included in the host GCC 11 now directly makes use of the Linux futex for the atomics. We will need to see if there is a way to globally disable the use of Linux futex, or implement an abstraction for it in the native_posix "SoC" somehow. p.s. as for whether this is a bug or an enhancement, it is hard to say because we do not currently have a supported C++ standard-features-compiler type and version matrix; but, I am inclined to say it is a bug since it does break something that used to work. |
Just yesterday I was successful in implementing a local work-around for this issue. The direct dependency within libstdc++ on the Linux futex API is conditionally enabled by the preprocessor symbol The symbol
Of course, this isn't feasible as a final solution, but it's a start. What should be possible is for Zephyr to provide a
Of course, the path to Zephyr's |
So I tried creating a parallel
I reverted my local customization to the system-wide This seems like a viable path for resolving this issue. Beyond fixing the futex issue, there still might be some additional things that could be added to Zephyr related to this topic. In the
While falling back on a mutex when building for the |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
Not stale. Still an issue. |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
Bump this was closed without resolution |
Describe the bug
Build generates a hard error when targeting the
native_posix
ornative_posix_64
board if the code includes the C++ standard library header<atomic>
.To Reproduce
Steps to reproduce the behavior:
main.cc
file as follows:prj.conf
:west build --board=native_posix
Expected behavior
Build should be complete without error.
Impact
Unable to target
native_posix
andnative_posix_64
boards for testing and development.Environment (please complete the following information):
Additional context
This issue does not occur with GCC 10.3.0. It is the result of
libstdc++
adding support forstd::atomic<T>::wait
. Atomic wait functionality was introduced with the C++20 standard. When built for Linuxlibstdc++
uses the kernel'sfutex
API to perform the waiting.The text was updated successfully, but these errors were encountered: