Skip to content
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

C Library Roadmap #45776

Open
3 of 6 tasks
stephanosio opened this issue May 18, 2022 · 6 comments
Open
3 of 6 tasks

C Library Roadmap #45776

stephanosio opened this issue May 18, 2022 · 6 comments
Assignees
Labels
area: C Library C Standard Library Feature A planned feature with a milestone Meta A collection of features, enhancements or bugs

Comments

@stephanosio
Copy link
Member

stephanosio commented May 18, 2022

This issue describes the future plans for the C library support in the Zephyr RTOS.

Tasks

Resources

@stephanosio stephanosio added Feature A planned feature with a milestone Meta A collection of features, enhancements or bugs labels May 18, 2022
@stephanosio stephanosio self-assigned this May 18, 2022
@stephanosio stephanosio added the area: C Library C Standard Library label May 19, 2022
@stephanosio
Copy link
Member Author

cc @keith-packard

@keith-packard
Copy link
Collaborator

Picolibc has an extensive internal test suite which started with the newlib test suite, has had numerous fixes applied and then extensions to validate newer standards versions. It could be made usable on non-picolibc targets. I've also hacked up the glibc source code to build against picolibc. That latter is all GPL, of course. Would it be reasonable to use those glibc bits for testing?

I do question the utility of working to fix newlib for greater Zephyr compatibility. As newlib is primarily used with Cygwin, there are very strict source and binary compatibility requirements which make any API changes very difficult to upstream. As picolibc already tracks newlib fixes outside of Cygwin support, it would be more useful to focus on improving picolibc's Zephyr support.

@keith-packard
Copy link
Collaborator

Which toolchains would need to be supported for picolibc to be used as the default C library? Picolibc currently works with Zephyr SDK, Crosstool-ng, and the GNU ARM Embedded Toolchain. It is known to not work with ARC MetaWare Development Toolkit. I don't know if it works with the Arm Compiler, the Cadence XCC compiler or the Intel oneAPI compiler. Given that the missing compiler support all appear to be licensed, if support for them is required, who can do the work?

@stephanosio
Copy link
Member Author

Which toolchains would need to be supported for picolibc to be used as the default C library?

Only the Zephyr SDK, since most Zephyr users are using it and all the upstream testing is done using the Zephyr SDK.

Given that the missing compiler support all appear to be licensed, if support for them is required, who can do the work?

For the proprietary compilers, it would be up to whoever maintains the compiler support to make that work. These compilers usually come with their own (certified) C library, so the picolibc may not be of much interest to their users anyway.

@keith-packard
Copy link
Collaborator

Should we set up an 'allow list' in the picolibc configuration so that people don't try to use picolibc with the proprietary toolchains?

@stephanosio
Copy link
Member Author

stephanosio commented Jan 28, 2023

Continuing from #54190 (comment):

Building Zephyr for C11 should likely involve using a Kconfig option rather than setting a CMake property in an arbitrary CMakeLists.txt, but this should be investigated in any case.

A Kconfig value such as CONFIG_LIBC_STD_C11 or something along those lines would probably be smart.

@cfriedt Currently, the C language standard to use for compiling C source code is specified through the CSTD CMake global property, whereas the C++ language standard to use for compiling C++ source code is specified through the STD_CPPxx Kconfig choices (e.g. STD_CPP11).

I acknowledge that this is inconsistent and needs to be improved -- preferably by settling on the Kconfig-only selection (e.g. STD_C99, STD_C11, ...); but, I would like @tejlmand's input on this since he is often opinionated on what should be CMake variables vs. Kconfigs.

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 Feature A planned feature with a milestone Meta A collection of features, enhancements or bugs
Projects
None yet
Development

No branches or pull requests

2 participants