[libcxx-dev] <atomic> for bare-metal development on ARM microcontrollers

Louis Dionne via libcxx-dev libcxx-dev at lists.llvm.org
Wed Jul 3 06:49:49 PDT 2019



> On Jun 30, 2019, at 15:12, JF Bastien via libcxx-dev <libcxx-dev at lists.llvm.org> wrote:
> 
> 
> 
>> On Jun 30, 2019, at 12:10 PM, Yves Delley <pu.y at delley.net> wrote:
>> 
>> 
>>> On 30 Jun 2019, at 18:21, JF Bastien <jfbastien at apple.com> wrote:
>>> 
>>> I think you want libc++ support for “freestanding”.
>> 
>> It looks like that's what I want :-). 
>> 
>>> We’ve discussed this e.g. in “D56913: decoupling Freestanding atomic<T> from	libatomic.a”. Olivier started some of this work for atomic.
>> 
>> Great - I had a quick glance over D56913 and the current bleeding edge of `<atomic>`. It seems that this should work for me. Except that there is still a "# error <atomic> is not supported on this single threaded system” at the top of `<atomic>`. Why is that? It seems that Olivier Giroux’s implementation contains it’s own lock, requiring no further thread-support. Anyway, I will give bleeding edge a try, simply removing that check and see how far I get.
> 
> I think it’s just that nobody’s tried to make it work.

Right, I just looked at it and I don’t see any reason why the combination of -D_LIBCPP_FREESTANDING / -D_LIBCPP_HAS_NO_THREADS would not work. Yves, would you be willing to check it out and report on whether it works? We may be able to get a simple patch in.

Louis

> 
> 
>>> It sounds like you’d like this work to continue :)
>> 
>> I certainly do. I strongly believe in C++ for small embedded and it’s a pity that MCU SDKs are mostly C. It would be great to get access to all the niceties of a modern C++ library just by implementing a handful of C primitives for the platform (one may always dream, right?). Is there anything I (as someone without deeper knowledge of libc++) could help with?
> 
> Sure! Patches would be great since you’re trying it out. I’m happy to help review with other libc++ folks as I think this is important.
> 
> _______________________________________________
> libcxx-dev mailing list
> libcxx-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev



More information about the libcxx-dev mailing list