-
Notifications
You must be signed in to change notification settings - Fork 20
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
libstdc++-v3: enable std::thread for zephyr via posix #25
libstdc++-v3: enable std::thread for zephyr via posix #25
Conversation
Tested to work with zephyrproject-rtos/zephyr#43729 as of commit The linked PR includes support and tests covering |
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.
In addition to the comments below, need to regenerate configure script as well.
636255d
to
63b345a
Compare
@stephanosio - I just saw that some zephyr things were hard-coded in the Are there some Zephyr-SDK specific steps to regenerating it? E.g. what about editing Otherwise, it would be like
I can imagine that is.. quite a bit of work.. and likely makes life significantly harder than it needs to be |
My recommendation would be to patch autoconf so that it knows about Zephyr, and then use this patched autoconf to regenerate the Besides giving a head start to upstreaming, this would mean never having to touch the generated files. Which is a lot more resilient. |
It is not hard-coded.
I have already submitted an upstream patch and it was accepted a while ago (it should already be part of the latest GCC Of course, that only makes it "recognise" the target, the rest of the target support still need to be added to GCC and Binutils (which is basically what zephyrproject-rtos/sdk-ng#350 describes). |
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.
Still need to regenerate configure
.
Oh nice - I guess my autoconf needs to be updated (has autoconf had a full release since then?).
Awesome - I almost forgot about that issue. It's been a while. Making progress though. |
4324e58
to
140e38a
Compare
a3b4e76
to
ae0b1ba
Compare
Use the existing gthr-posix.h configuration for gthreads to enable support in Zephyr for C++ std::thread, std::mutex, std::condition_variable, std::binary_semaphore, std::counting_semaphore, and more. Signed-off-by: Chris Friedt <cfriedt@meta.com>
e8326cf
to
40469b4
Compare
Regenerate the ./configure script with zephyr-specific conditions to enable std::thread, std::mutex, std::condition_variable, std::binary_semaphore, std::counting_semaphore, etc. Signed-off-by: Chris Friedt <cfriedt@meta.com>
This change adds a zephyr-bits.h header file which includes the basic definitions required to support ISO C++ thread, mutex, condition variables, and more via POSIX. For additional details see libgcc/gthr-posix.h . Note: this header should not be exported; it is solely for the purpose of enabling C++ threads in the Zephyr SDK when building against newlib or picolibc. Signed-off-by: Chris Friedt <cfriedt@meta.com>
Touch-up the generated configure script to reflect changes in configure.ac . Signed-off-by: Chris Friedt <cfriedt@meta.com>
40469b4
to
14eae62
Compare
Building the Zephyr SDK manually is successful with the current changes in #25 and zephyrproject-rtos/sdk-ng#722 but unfortunately CI fails without really having any kind of decent diagnostics or debug information. build.log.xz.txt ( Not really sure where to go from here. |
Closing this in favour of the c11 altrnative |
Add scaffolding to set required zephyr-specific bits for gcc in order to enable standard C++ threads, mutexes, condition variables, etc, using the POSIX API as a foundation.
Note: it is not possible to run compile and / or link tests under libstdc++-v3 at this time.