Is this comment still true? source: libc.llvm.org
“The libc is not complete. If you need a fully functioning C library right now, you should continue to use your standard system libraries.”
If yes, what features/functionalities are missing?
Thanks in advance.
Yes, it’s still true and is expected to be for 2-3 years. At the moment, the focus has been largely on performance-oriented functions and building out other things as needed to promote self-hosting for LLVM and similar pieces. There are efforts around time/date functions and networking going on as well as a number of POSIX pieces. i18n, shared library are completely missing. Threading exists but is only minimally tested. Also RISC-V bringup has just started, so there’s a lot of work there.
I hope that helps!
The level of completeness depends on your use case. If you need full POSIX compliance, then there are many missing pieces and holes. But, if you want a C standard compliant implementation, then the main missing pieces are:
- locale and i8n support.
- Double and higher precision math functions
With respect to RISC-V support, the RISC-V 64-bit support is more comprehensive than the aarch64 support and has only one missing piece in comparison to the x86_64 support. That missing piece is actively being worked on: ⚙ D147738 [libc] Enable linux directory entries syscalls in riscv64. Most of it will just work for RISC-V 32-bit also but bringing it up on par with the 64-bit support is also actively being worked on: ⚙ D148371 [libc] Add support to compile some syscalls on 32 bit platform.
could you comment on printf status?
Hi, I’m the person working on printf.
Printf is complete with a few exceptions: It can’t handle wide characters and it can’t handle decimal long doubles. If you’re intending to use it for an embedded use case then we have compile flags to shrink the compiled code size, specifically disabling index mode and floating point handling altogether.
Hope that helps, feel free to ask if you’ve got more questions on the specifics.
You may know that we have a regular LLVM Embedded Toolchains Working Group sync up where the topic of LLVM libc is of interest and was discussed at length previously. LLVM libc maintainers are usually in the call, so you are welcome to join should you want to discuss more details, explain the use case and needs, etc.
Calendar invite and dial in details are in LLVM Embedded Toolchains Working Group sync up