News: 0001517357

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

GCC Goes For "libc Diversity" With Picolibc Support

([GNU] 2 Hours Ago libc Diversity)


Keith Packard is known for his X.Org/X11 work over the course of many years but alongside other software projects he also maintains Picolibc as a C library designed for embedded 32-bit and 64-bit systems. Recently he sent out a patch for adding Picolibc support to the GCC compiler.

During some New Year hacking, Keith Packard worked up [1]patches for adding support for Picolibc to serve as the C library for use with GCC.

"The first patch in this series selects picolibc as the default C library when the target is *-picolibc-*. This configures the default compiler specs for picolibc usage, including the addition of three picolic-specific options.

The section patch in this series allows the default C library to be explicitly selected, separately from the target name. This allows toolchains for targets like Zephyr to default to picolibc without needing to include 'picolibc' in the target name."

The new options for the picolibc target include --oslib= for inserting an OS library after the C library, --crt0= for an alternative crt0 to use in place of the one provided by Picolibc, and --printf= for specifying a customized version of printf instead of the one linked from the C library.

Upstream Picolibc supports a variety of targets such as ARC, ARM, m68k, MIPS, MSP430, Nios II, POWER9, RISC-V, and others plus x86_64 and i386 that are primarily for testing purposes.

The Picolibc support patches have yet to be merged to upstream GCC, but as mentioned by the GNU Tools on [2]X , they are in favor of libc diversity. In addition to the GNU C Library (glibc), upstream GCC also supports other libc implementations like Bionic, uClibc, and musl.



[1] https://gcc.gnu.org/pipermail/gcc-patches/2025-January/672414.html

[2] https://x.com/gnutools/status/1876304913787220379



MastaG

That gets us out of deciding how to spell Reg[eE]xp?|RE . . .
Of course, then we have to decide what ref $re returns... :-)
-- Larry Wall in <199710171838.LAA24968@wall.org>