Description
#44096 introduced the picolibc, a full-featured yet light-weight C library and fork of newlib, as a module for Zephyr that can be configured and fine-tuned at the Zephyr build time to minimise its footprint.
This issue describes the tasks required for making the picolibc the default C library support in the Zephyr RTOS.
Tasks
- Adding picolibc as a module #44143
- Add picolibc documentation #49620
- Ensure that picolibc is compatible with and tested on all architectures supported by Zephyr
- aarch64-zephyr-elf
- arc-zephyr-elf
- arc64-zephyr-elf
- arm-zephyr-eabi
- mips-zephyr-elf
- nios2-zephyr-elf
- riscv64-zephyr-elf
- sparc-zephyr-elf
- x86_64-zephyr-elf
- xtensa-*zephyr-elf
- Bundle picolibc in Zephyr SDK for libstdc++ integration
(Add picolibc sdk-ng#602) - Fix any incompatibilities with the picolibc in the Zephyr codebase. These are validated in Complete set of changes to enable picolibc by default #60124.
- modules/hal/openisa: Support building without -ffreestanding #51908
- Add -lc -lgcc from picolibc toolchain library after module libraries #51949
- (modules: Update picolibc to 1.8 #53337)
- (Allow use of SDK version of picolibc with C++ #53338)
- (libc: Add remaining picolibc-supported targets #53339)
- (samples/modules/chre: Support picolibc %p for NULL pointers #53574)
- (samples/philosophers: Make output atomic with picolibc #53575)
- (sample/zbus: qemu_nios2 needs faster tick for zbus test with picolibc #53684)
- (Enabling TLS detects stack overflow in a few tests #53687)
- (modules/cmsis: Change libc requirement to allow picolibc #53950)
-
subsys/bluetooth: Avoid RX overflow in lt_tx_real_no_encode #54119(no longer appears to cause test suite failures) - qemu_x86_tiny places picolibc text outside of pinned.text #54148
- lib/libc: Enable picolibc on qemu_x86_tiny #54186
- modules/picolibc: Include clang+cmake and old GCC changes #54394
- Switch return type of main from 'void' to 'int' #54628
- Allow tests to filter on availability of full C library #54637
- Only use -ffreestanding with minimal C library #54638
- modules/audio/sof: Pull fix for main return type #57398
- Fix linker scripts to define _end correctly #57727
- libc/common: Add memalign #58012
- libc/common: malloc fixes #58450
- tests, samples: Fix a bunch of new instances of
void main(void)
#58458 - tests: Increase a couple of test stack sizes #58459
-
tests/c_lib: strerror_r is POSIX #58460(Removes_POSIX_C_SOURCE
from CFLAGS: not a compatibility fix) - libc/picolibc: Picolibc fixes #58462
-
tests/iterable_sections: Set common stack arena size to zero #58464(no longer necessary for this test to work) -
tests/spinlock: Terminate temporary thread after tests #60123(Fixed via Testcases fixes #60567) - samples/boards/google_twinkie_v2_pda: fix main return #61233
- Document the policy to ensure that the Zephyr kernel can keep building with the minimal libc
- Document the policy to prevent the abuse of non-standard functions available in Picolibc
- Implement tests and CI checks to enforce the above policies
- Enforce "Rule A.4: C Standard Library Usage Restrictions in Zephyr Kernel"
- Build the "Zephyr kernel" tests with the minimal libc to ensure that they are compatible with the minimal libc. tests/kernel/common: Add an explicit test using the minimal C library #58108
- Enforce "Rule A.5: C Standard Library Usage Restrictions in Zephyr Codebase"
- Add
_ZEPHYR_SOURCE
support to Picolibc to limit the visibility of non-standard functions from the Zephyr codebase. modules/lib/picolibc: Use version with _ZEPHYR_SOURCE support #58106 - Add a CI check to prevent any upstream source files from defining the feature test macros (e.g. _GNU_SOURCE) to pull "disallowed" functions. scripts/checkpatch: Check for patches adding #defines for libc APIs #60487
- Add
- Enforce "Rule A.4: C Standard Library Usage Restrictions in Zephyr Kernel"
- Document module and toolchain-bundled Picolibc synchronisation policy
- Initial proposal: Make picolibc the default C library for Zephyr #49922 (comment)
- Zephyr doc update: Add module and toolchain-bundled Picolibc synchronisation policy #58006
- sdk-ng doc update: README: Add submodule update process sdk-ng#673
- Make
PICOLIBC
the defaultLIBC_IMPLEMENTATION
Related discussions
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status
Status
Done