Ivan-Velickovic/picolibc
picolibc - a C library designed for embedded 32- and 64- bit systems.
Picolibc
Copyright © 2018-2023 Keith Packard
Picolibc is library offering standard C library APIs that targets
small embedded systems with limited RAM. Picolibc was formed by blending
code from Newlib and
AVR Libc.
Build status:
License
Picolibc source comes from a variety of places and has a huge variety
of copyright holders and license texts. While much of the code comes
from Newlib, none of the GPL-related bits used to build the library
are left in the repository, so all of the source code uses BSD-like
licenses, a mixture of 2- and 3- clause BSD itself and a variety of
other (mostly older) licenses with similar terms.
There are two files used for testing printf, test/printf-tests.c and
test/testcases.c which are licensed under the GPL version 2 or
later. There is also a shell script, GeneratePicolibcCrossFile.sh
which is licensed under the AGPL version 3 or later which is provided
as a helper for people building the library, but not used by picolibc
otherwise.
The file COPYING.picolibc contains all of the current copyright and
license information in the Debian standard machine-readable format. It
was generated using the make-copyrights and find-copyright
scripts.
Supported Architectures
Picolibc has integrated testing support for many architectures which
is used to validate the code for all patch integration:
- ARC (32- and 64- bit)
- ARM (32- and 64- bit)
- i386 (Native and Linux hosted, for testing)
- Motorola 68000 (m68k)
- MIPS
- MSP430
- Nios II
- Power9
- RISC-V (both 32- and 64- bit)
- SparcV8 (32 bit)
- x86_64 (Native and Linux hosted, for testing)
There is also build infrastructure and continuous build validation,
but no integrated testing available for additional architectures:
- Microblaze (32-bit, big and little endian)
- PowerPC (big and little endian)
- Sparc64
- Xtensa (ESP8266, ESP32)
Supporting architectures that already have Newlib code requires:
-
newlib/libc/machine/architecture/meson.build to build the
architecture-specific libc bits. This should at least include
setjmp/longjmp support as these cannot be performed in
architecture independent code and are needed by libstdc++. -
Checking for atomic support for tinystdio. Tinystdio requires
atomics for ungetc to work correctly in a reentrant
environment. By default, it stores them in 16-bit values, but
some architectures only have 32-bit atomics. To avoid ABI
issues, the size selected isn't detected automatically, instead
it must be configured in newlib/libc/tinystdio/stdio.h. -
newlib/libm/machine/architecture/meson.build to build any
architecture-specific libm bits -
picocrt/machine/architecture source code and build bits
for startup code needed for the architecture. Useful in all
cases, but this is necessary to run tests under qemu if your
platform can do that. -
cross-gcc-triple.txt to configure the meson cross-compilation
mechanism to use the right tools -
do-architecture-configure to make testing the cross-compilation
setup easier. -
newlib/libc/picolib support. This should include whatever startup
helpers are required (like ARM interrupt vector) and TLS support
(if your compiler includes this). -
run-architecture script to run tests under QEMU. Look at the ARM
and RISC-V examples to get a sense of what this needs to do and
how it gets invoked from the cross-gcc-triple.txt configuration
file.
Relation to newlib
Picolibc is mostly built from pieces of newlib, and retains the
directory structure of that project. While there have been a lot of
changes in the build system and per-thread data storage, the bulk of
the source code remains unchanged.
To keep picolibc and newlib code in sync, newlib changes will be
regularly incorporated. To ease integration of these changes into
picolibc, some care needs to be taken while editing the code:
- Files should not be renamed.
- Fixes that also benefit users of newlib should also be sent to the
newlib project - Changes, where possible, should be made in a way compatible with
newlib design. For example, instead of using 'errno' (which is
valid in picolibc), use __errno_r(r), even when 'r' is not defined
in the local context.
The bulk of newlib changes over the last several years have been in
areas unrelated to the code used by picolibc, so keeping things in
sync has not been difficult so far.
Documentation
Introductory documentation. Read these first:
- Building Picolibc. Explains how to compile picolibc yourself.
- Using Picolibc. Shows how to compile and link
applications once you have picolibc built and installed. - Linking with Picolibc.ld. Provides more details
about the linking process. - Hello World. Build and run a stand-alone C
application by following step-by-step instructions
Detailed documentation. Use these to learn more details about how to
use Picolibc:
- Picolibc initialization
- Operating System Support.
- Printf and Scanf in Picolibc
- Thread Local Storage
- Re-entrancy and Locking
- Picolibc as embedded source
- Releasing Picolibc
- Copyright and license information
Releases
Picolibc version 1.8.5
-
Detect clang multi-lib support correctly by passing compiler flags.
Thanks to xbjfk for identifying the problem. -
Create a new 'long-long' printf variant. This provides enough
variety to satisfy the Zephyr cbprintf options without needing to
build the library from scratch. -
Adjust use of custom binary to decimal conversion code so that it
is only enabled for types beyond the register size of the
target. This avoids the cost of this code when the application is
already likely to be using the soft division routines.
Picolibc version 1.8.4
-
Make math overflow and underflow handlers respect rounding modes.
-
Add full precision fma/fmaf fallbacks by adapting the long-double
code which uses two floats/doubles and some careful exponent
management to ensure that only a single rounding operation occurs. -
Fix more m68k 80-bit float bugs
-
Fix m68k asm ABI by returning pointers in %a0 and %d0
-
Use an m68k-unknown-elf toolchain for m68k testing, including
multi-lib to check various FPU configurations on older and more
modern 68k targets. -
Improve CI speed by using ccache on zephyr and mac tests,
compressing the docker images and automatically canceling jobs when
the related PR is updated. Thanks to Peter Jonsson. -
Move a bunch of read-only data out of RAM and into flash by adding
'const' attributes in various places. -
Add a new linker symbol,
__heap_size_min, which specifies a
minimum heap size. The linker will emit an error if this much space
is not available between the end of static data and the stack. -
Fix a bunch of bugs on targets with 16-bit int type. Thanks to
Peter Jonsson for many of these. -
Work around a handful of platform bugs on MSP430. I think these are
compiler bugs as they occur using both the binutils simulator and
mspsim. -
Run tests on MSP430 using the simulator that comes with gdb. Thanks to
Peter Jonsson for spliting tests apart to make them small enough to
link in under 1MB. This requires a patch adding primitive
semihosting to the simulator. -
Provide a division-free binary to decimal conversion option for
printf at friends. This is useful on targets without hardware
divide as it avoids pulling in a (usually large) software
implementation. This is controlled with the 'printf-small-ultoa'
meson option and is 'false' by default. -
Add 'minimal' printf and scanf variants. These reduce functionality
by removing code that acts on most data modifers including width
and precision fields and alternate presentation modes. A new config
variable, minimal-io-long-long, controls whether that code supports
long long types. -
Add a 'assert-verbose' option which controls whether the assert
macro is chatty by default. It is 'true' by default, which
preserves the existing code, but when set to 'false', then a
failing assert calls __assert_no_msg with no arguments, saving the
memory usually occupied by the filename, function name and
expression. -
Fix arm asm syntax for mrc/mcr instructions to make clang happy.
Thanks to Radovan Blažek for this patch.
Picolibc version 1.8.3
-
Fix bugs in floor and ceil implementations.
-
Use -fanalyzer to find and fix a range of issues.
-
Add __ubsan_handle_out_of_bounds implementation. This enables
building applications with -fsanitize=bounds and
-fno-sanitize-undefined-trap-on-error. -
Validate exception configuration on targets with mixed exception
support where some types have exceptions and others don't. Right
now, that's only arm platforms where any soft float implementations
don't build with exception support. -
Fix bugs in nexttowards/nextafter on clang caused by the compiler
re-ordering code and causing incorrect exception generation. -
Use the small/slow string code when -fsanitize=address is used
while building the library. This avoids reading beyond the end of
strings and triggering faults. -
Handle soft float on x86 and sparc targets. That mostly required
disabling the hardware exception API, along with a few other minor
bug fixes. -
Add runtime support for arc, mips, nios2 and m68k. This enables CI
testing on these architectures using qemu. -
Fix 80-bit floating math library support for m68k targets.
-
Fix arm testing infra to use various qemu models that expand
testing to all standard multi-lib configurations. -
Adjust floating exception stubs to return success when appropriate,
instead of always returning ENOSYS. -
Make sure sNaN raises FE_INVALID and is converted to qNaN in
truncl, frexpl and roundl -
Avoid NaN result from fmal caused by multiply overflow when
addend is infinity (-inf + inf results in NaN in that case).
Picolibc version 1.8.2
-
Support _ZEPHYR_SOURCE macro which, like _POSIX_SOURCE et al,
controls whether the library expresses the Zephyr C library API.
This is also automatically selected when the ZEPHYR macro is
defined and no other _*_SOURCE macro is defined. -
Add another cross compile property, 'libgcc', which specifies the
library containing soft float and other compiler support routines. -
Fix a couple of minor imprecisions in pow and 80-bit powl.
-
Merge newlib changes that included an update to the ARM assembly
code. -
Replace inexact float/string conversion code with smaller code that
doesn't use floating point operations to save additional space on
soft float targets. -
More cmake fixes, including making the inexact printf and locale
options work.
Picolibc version 1.8.1
-
Fix cmake build system to auto-detect compiler characteristics
instead of assuming the compiler is a recent version of GCC. This
allows building using cmake with clang. -
Fix cmake build system to leave out TLS support when TLS is
disabled on the cmake command line. -
Replace inline asm with attributes for __weak_reference macro
-
Add allocation attributes to malloc and stdio functions. This
allows the compiler to detect allocation related mistakes as well
as perform some additional optimizations. Bugs found by this change
were also addressed. -
Add wchar_t support to tinystdio, eliminating the last missing
feature compared with the legacy stdio bits from newlib. With this,
libstdc++ can be built with wide char I/O support, eliminating the
last missing feature there as well. -
Eliminate use of command line tools when building with a new enough
version of meson. Thanks to Michael Platings. -
Add Microblaze support. Thanks to Alp Sayin.
-
Switch semihosting to use binary mode when opening files. Thanks to
Hardy Griech. -
Build and install static library versions of the crt0 startup
code. These allows developers to reference them as libraries on the
command line instead of needing special compiler support to locate
the different variants, which is useful when using clang. Thanks to
Simon Tatham. -
Simplify the signal/raise implementation to use a single global
array of signal handlers and to not use getpid and kill, instead
raise now directly invokes _exit. This makes using assert and abort
simpler and doesn't cause a large TLS block to be allocated. Thanks
to Joe Nelson for discovering the use of a TLS variable here.
Picolibc version 1.8
With the addition of nearly complete long double support in the math
library, it seems like it's time to declare a larger version increment
than usual.
-
Improve arc and xtensa support, adding TLS helpers and other build fixes
-
Fix FPSCR state for Arm8.1-M low overhead loops (thanks to David
Green) -
Add -Werror=double-promotion to default error set and fix related
errors. (thanks to Ryan McClelland) -
Fix locking bug in malloc out-of-memory path and freeing a locked
mutex in the tinystdio bufio code. These were found with lock
debugging code in Zephyr. -
Add some missing functions in tinystdio, strto*l_l, remove,
tmpname/tmpfile which were published in stdio.h but not included in
the library. -
Switch read/write functions to use POSIX types instead of legacy
cygwin types. This makes mapping to existing an POSIX api work
right. -
Add %b support to tinystdio printf and scanf. These are disabled by
default as they aren't yet standardized. -
Fix avr math function support. The avr version of gcc has modes
where double and long double are 32 or 64 bits, so the math library
code now detects all of that at compile time rather than build time
and reconfigures the functions to match the compiler types. -
Add nearly complete long double support from openlibm for 80-bit
Intel and 128-bit IEEE values (in addition to supporting 64-bit
long doubles). Still missing are Bessel functions and decimal
printf/scanf support. -
Add limited long double support for IBM 'double double' form. This
is enough to run some simple tests, but doesn't have any
significant math functions yet. -
Get Power9 code running under qemu with OPAL. This was mostly
needed to validate the big-endian and exception code for 128-bit
long doubles, but was also used to validate the double double
support. -
Provide times() and sysconf() implementations in semihosting. You
can now build and run the dhrystone benchmark without any further
code. -
Fix use of TLS variables with stricter alignment requirements in
the default linker script and startup code. (thanks to Joakim
Nohlgård and Alexander Richardson who found this issue while
working on lld support).
Picolibc version 1.7.9
-
Support all Zephyr SDK targets
-
Support relocating the toolchain by using GCC_EXEC_PREFIX for
sysroot-install when compiler doesn't use sysroot. -
Add MIPS, SPARC and ARC support
-
Deal with RISC-V changes in gcc that don't reliably include zicsr
-
Support Picolibc as default C library with -Dsystem-libc option.
With this, you can use picolibc without any extra compiler options. -
Merge current newlib bits to get code that doesn't use struct _reent
-
Get rid of struct _reent in legacy stdio code
-
Support 16-bit int targets by fixing a few places assuming
sizeof(int) == 4, object sizes not using size_t, wint_t for
ucs-4 values -
Add MSP430 support
-
Fix a couple of clang bugs (one on Cortex M0)
-
Support libc++ by adding non-standard mbstate_t.h
-
Merge i686 and x86_64 code to allow x86 multilib builds
-
Merge Xtensa newlib bits
-
Support Xtensa ESP32 targets
-
Add Nios II support
Picolibc version 1.7.8
-
Fix el/ix level 4 code type errors
-
Fix out-of-source CMake build (thanks Max Behensky)
-
Improve build.md docs (thanks Kalle Raiskila)
-
Fix cmake build for various architectures
-
Initialize lock in fdopen
-
Remove %M from linker paths in single-arch builds
-
Shrink tinystdio vfprintf and vfscanf a bit
-
Use -fno-builtin-malloc -fno-builtin-free (GCC 12 compat)
-
Use -fno-builtin-copysignl (GCC 12 compat)
-
Add _zicsr to -march for risc-v picocrt (binutils 2.38 compat)
-
Add -no-warn-rwx-segments to link spec (binutils 2.38 compat)
Picolibc version 1.7.7
-
Fix semihost gettimeofday, add a test.
-
Fix config option documentation. (Thanks to rdiez)
-
Document how re-entrant locking APIs are used. (Thanks to rdiez)
-
Fix some 16-bit int issues in tinystdio. (Thanks to Ayke van
Laethem) -
Make header files a bit more POSIX compliant, installing rpc
headers, moving byte swapping macros to arpa/inet.h -
Fix some stdio bugs found by Zephyr test suite: snprintf return
value on buffer overflow, add ftello/fseeko, fputc return value,
%0a formatting, clear EOF status after ungetc/fseek. -
Re-do buffered I/O support to handle mixed read/write files
correctly. This adds setbuf, setbuffer, setlinebuf, setvbuf. -
Add fmemopen and freopen.
-
Add enough cmake support to allow Zephyr to build picolibc as a
module using that, rather than meson. -
Merge current newlib bits
-
Fix %p printf/scanf on ILP64 targets.
Picolibc version 1.7.6
-
Fix use with C++ applications caused by a syntax error in
picolibc.specs -
Automatically include '-nostdlib' to options used while
evaluating build rules to ensure tests work as expected. -
Publish aarch64 inline math functions, ensure that inline fma
functions work in installed applications for arm and risc-v.
Picolibc version 1.7.5
-
Fix build on big-endian systems (thanks to Thomas Daede)
-
Add m68k support (thanks to Thomas Daede).
-
Fix build issues with ARM Cortex-a9 target (thanks to Ilia
Sergachev). -
Fix fwrite(x,0,y,z) in both tinystdio and legacy stdio. tinystdio
returned the wrong value and legacy stdio caused a divide-by-zero
fault. -
Update Ryu code to match upstream (minor fixes)
-
Fix various __NEWLIB and __PICOLIBC macros; they were using a
single leading underscore instead of two (thanks to Vincent
Palatin). -
Fix tinystdio error-handling bugs
-
Merge recent newlib changes (fixed ltdoa in legacy stdio)
-
Speed improvements for github CI system
-
Big-endian PowerPC support
-
Fail builds if most 'run_command' uses fail (thanks to Johan de
Claville Christiansen) -
Positional parameters in tinystdio. With this, I think tinystdio
is feature complete. -
Support for multiple build-styles of picolibc (minsize/release)
in one binary package. This still requires separate meson runs. -
Testing with glibc test code. This uncovered numerous bugs,
mostly math errno/exception mistakes, but also a few serious
bugs, including a couple of places where the nano-malloc failed
to check for out-of-memory. Picolibc now passes all of the glibc
math tests except for jn, yn, lgamma and tgamma. The picolibc
versions of those functions are too inaccurate. Picolibc also
passes most other relevant glibc tests, including stdio,
string and stdlib areas. -
Tinystdio version of fcvt now has a static buffer large enough to
hold the maximum return size. -
Tinystdio versions of ecvtbuf and fcvtbuf have been replaced
with ecvt_r and fcvt_r equivalents, which take a 'len' parameter
to prevent buffer overruns. -
Add the GeneratePicolibcCrossFile.sh script which provides a way
to isolate picolibc build scripts from the vagaries of meson
version shifts (thanks to R. Diez). -
Add 'semihost' version of crt0 that calls 'exit' after main
returns. The ARM and RISC-V versions of this also include trap
handlers for exceptions that print out information and exit when
an exception occurs.
Picolibc version 1.7.4
-
Clean up meson build bits, including use of 'fs module (thanks to
Yasushi Shoji). -
Speed up github actions by sharing Debian docker image (thanks to
Yasushi Shoji). -
Reduce use of intermediate static libraries during build
-
Use standard Meson architecture names everywhere (thanks to
Yasushi Shoji). -
Support building with -D_FORTIFY_SOURCE enabled.
-
Clean up 32-bit arm assembly code, eliminating __aeabi wrappers
where possible. -
Add basename, dirname and fnmatch back.
-
Fix all old-style (K&R) function definitions.
-
Enable lots more compiler warning flags.
-
Remove last uses of alloca in legacy stdio code.
-
Add tests from musl libc-testsuite. There aren't many tests, but
these identified a few bugs. -
Add lots more exception and errno tests for the math functions.
-
Restructure math library to always use the
__math_errfunctions
to raise exceptions and set errno. This removes the w_*.c wrapper
functions and eliminates the__ieee names. This centralizes
compiler work-arounds to ensure run-time evaluation of
expressions intended to raise exceptions. In the process, all of
the libm/math files were reformatted with clang-format. -
Make tinystdio '%a' compatible with glibc, including supporting
rounding and trimming trailing zeros when possible. -
Remove floating point exception generation code on targets
without floating point exception support. This reduces code size
on soft float machines without affecting results.
Picolibc version 1.7.3
-
Add -Wall -Wextra to default builds. Fixed warnings this raised.
-
Add htonl and friends (based on __htonl). Thanks to Johan de
Claville Christiansen -
Set errno in scalbn and scalbnf (patch forwarded to newlib).
-
Merge newlib recent changes which includes a couple of libm fixes.
Picolibc version 1.7.2
-
Fix picolibc.ld to split C++ exceptions back apart (thanks to
Khalil Estell) -
Add vsscanf to tinystdio (required for libstdc++).
-
Also stick -isystem in C++ compile command to try and get
picolibc headers to be used instead of newlib.
Picolibc version 1.7.1
-
Add __cxa_atexit implementation to 'picoexit' path as required by
C++ -
Fix lack of 'hh' support in integer-only tinystdio printf path.
-
Fix tinystdio __file flag initialization for C++ apps
Picolibc version 1.7
-
Merge libc and libm into a single library. Having them split
doesn't offer any advantages while requiring that applications add
'-lm' to link successfully. Having them merged allows use of libm
calls from libc code. -
Add hex float format to *printf, *scanf and strto{d,f,ld}. This is
required for C99 support. -
Unify strto{d,f,ld} and *scanf floating point parsing code. This
ensures that the library is consistent in how floats are parsed. -
Make strto{d,f,ld} set errno to ERANGE on overflow/underflow,
including when the result is a subnormal number.
Picolibc version 1.6.2
-
Change
restrictkeyword in published headers to__restrictto
restore compatibility with applications building with --std=c18. -
Additional cleanups in time conversion funcs (Thanks to R. Riez)
Picolibc version 1.6.1
-
Code cleanups for time conversion funcs (Thanks to R. Diez)
-
Add '-fno-stack-protector' when supported by the C compiler
to avoid trouble building with native Ubuntu GCC. -
Bug fix for converting denorms with sscanf and strto{d,f,ld}.
-
Use asm for inline asm code to allow building applications
with --std=c18 -
Fix exit code for semihosting 'abort' call to make it visible
to the hosting system. -
Add strfromf and strfromd implementations. These are simple
wrappers around sscanf, but strfromf handles float conversions
without requiring a pass through 'double' or special linker hacks.
Picolibc version 1.6
-
Bugfix for snprintf(buf, 0) and vsnprintf(buf, 0) to avoid
smashing memory -
Support building libstdc++ on top of picolibc
-
Add 'hosted' crt0 variant that calls exit when main
returns. This makes testing easier without burdening embedded apps
with unused exit processing code. -
Add 'minimal' crt0 variant that skips constructors to
save space on systems known to not use any. -
Fix HW floating point initialization on 32-bit ARM processors to
perform 'dsb' and 'isb' instructions to ensure the FPU enabling
write is complete before executing any FPU instructions. -
Create a new '--picolibc-prefix' GCC command line parameter that
sets the base of all picolibc file names. -
Add bare-metal i386 and x86_64 initializatiton code (thanks to
Mike Haertel). These initalize the processor from power up to
running code without requiring any BIOS. -
Merge newlib as of late April, 2021
-
Add 'timegm' function (thanks to R. Diez).
-
Fix a number of tinystdio bugs: handle fread with size==0, parse
'NAN' and 'INF' in fscanf in a case-insensitive manner, fix
negative precision to '*' arguments in printf, fix handling of
'j', 'z' and 't' argument size specifiers (thanks to Sebastian
Meyer). -
Make the fenv API more consistent and more conformant with the
spec. All architectures now fall back to the default code
for soft float versions, which avoids having the various exception
and rounding modes get defined when not supported.
Picolibc version 1.5.1
- Make riscv crt0 '_exit' symbol 'weak' to allow linking without
this function.
Picolibc version 1.5
-
Make picolibc more compatible with C++ compilers.
-
Add GCC specs file and linker script for building C++ applications
with G++ that enable exception handling by linking in call stack
information. -
A few clang build fixes, including libm exception generation
-
Nano malloc fixes, especially for 'unusual' arguments
-
Merge in newlib 4.1.0 code
-
More libm exception/errno/infinity fixes, mostly in the gamma funcs.
-
Add tests for all semihost v2.0 functions.
-
A few RISC-V assembly fixes and new libm code.
-
Build fixes to reliably replace generic code with
architecture-specific implementations.
With a patch which is pending for GCC 11, we'll be able to build C++
applications that use picolibc with exceptions and iostream.
Picolibc version 1.4.7
-
Fix numerous libm exception and errno bugs. The math functions are
all now verified to match the C19 and Posix standards in this
area. -
Change behavior of 'gamma' function to match glibc which returns
lgamma for this function. Applications should not use this
function, they should pick either lgamma or tgamma as appropriate. -
Fix fma/fmaf on arm and RISC-V so that the machine-specific versions
are used when the hardware has support. Also fix the math library
to only use fma/fmaf when it is supported by the hardware. -
Fix numerous nano-malloc bugs, especially with unusual parameters.
-
Change nano-malloc to always clear returned memory.
-
Improve nano-realloc to perform better in various ways, including
merging adjacent free blocks and expanding the heap. -
Add malloc tests, both a basic functional test and a stress test.
-
Improve build portability to Windows. Picolibc should now build
using mingw. -
Use hardware TLS register on ARM when available.
-
Support clang compiler. Thanks to Denis Feklushkin
denis.feklushkin@gmail.com and Joakim Nohlgård joakim@nohlgard.se. -
Avoid implicit float/double conversions. Check this by having
clang builds use -Wdouble-promotion -Werror=double-promotion
flags -
Have portable code check for machine-specific overrides by
matching filenames. This avoids building libraries with
duplicate symbols and retains compatibility with newlib (which
uses a different mechanism for this effect). -
Patches to support building with CompCert, a
formally verified compiler. Thanks to Sebastian Meyer
meyer@absint.com.
Picolibc version 1.4.6
-
Install 'ssp' (stack smashing protection) header files. This fixes
compiling with -D_FORTIFY_SOURCE. -
Make getc/ungetc re-entrant. This feature, which is enabled by
default, uses atomic instruction sequences that do not require
OS support. -
Numerous iconv fixes, including enabling testing and switching
external CCS file loading to use stdio. By default, iconv provides
built-in CCS data for all of the supported encodings, which takes
a fairly large amount of read-only memory. Iconv is now always
included in picolibc as it isn't included in applications unless
explicitly referenced by them. -
Add __getauxval stub implementation to make picolibc work with
GCC version 10 compiled for aarch64-linux-gnu. -
Change how integer- and float- only versions of printf and scanf
are selected. Instead of re-defining the symbols using the C
preprocessor, picolibc now re-defines the symbols at link
time. This avoids having applications compiled with a mixture of
modes link in multiple versions of the underlying functions, while
still preserving the smallest possible integer-only
implementation. -
Document how to use picolibc on a native POSIX system for
testing. Check out the os.md file for details. -
Merge current newlib bits in. This includes better fenv support,
for which tests are now included in the picolibc test suite.
Picolibc version 1.4.5
-
Fix section order in picolibc.ld to give applications correct
control over the layout of .preserve, .init and .fini regions. -
Add startup and TLS support for aarch64 and non Cortex-M 32-bit
arm.
Picolibc version 1.4.4
-
Fix floating point 'g' format output in tinystdio. (e.g.,
for 10.0, print '10' instead of '1e+01'). There are tests which
verify a range of 'g' cases like these now. -
Merge current newlib bits. The only thing which affects picolibc
is the addition of fenv support for arm.
Picolibc version 1.4.3
-
Make fix for CVE 2019-14871 - CVE 2019-14878 in original newlib
stdio code not call 'abort'. Allocation failures are now reported
back to the application. -
Add 'exact' floating point print/scan code to tinystdio. Thanks
to Sreepathi Pai for pointing me at the Ryu code by Ulf
Adams. -
Add regular expression functions from newlib. These were removed
by accident while removing POSIX filesystem-specific code. -
Make tinystdio versions of [efg]cvt functions. This means that the
default tinystdio version of picolibc no longer calls malloc from
these functions. -
More clang-compatibility fixes. (Thanks to Denis Feklushkin)
-
Remove stdatomic.h and tgmath.h. (they should not be provide by picolibc)
Picolibc version 1.4.2
-
Clang source compatibility. Clang should now be able to compile
the library. Thanks to Denis Feklushkin for figuring out how
to make this work. -
aarch64 support. This enables the existing aarch64 code and
provides an example configuration file for getting it
built. Thanks for Anthony Anderson for this feature. -
Testing on github on push and pull-request. For now, this is
limited to building the library due to a bug in qemu. -
Get newlib stdio working again. You can now usefully use Newlib's
stdio. This requires a working malloc and is substantially larger
than tinystdio, but has more accurate floating point input. This
requires POSIX functions including read, write and a few others. -
Fix long double strtold. The working version is only available
when using tinystdio; if using newlib stdio, strtold is simply not
available. -
Improve tinystdio support for C99 printf/scanf additions.
-
Check for correct prefix when sysroot-install option is
selected. The value of this option depends on how gcc was
configured, and (alas) meson won't let us set it at runtime, so
instead we complain if the wrong value was given and display the
correct value. -
Sync up with current newlib head.
Picolibc version 1.4.1
This release contains an important TLS fix for ARM along with a few
minor compatibility fixes
-
Make __aeabi_read_tp respect ARM ABI register requirements to
avoid clobbering register contents during TLS variable use. -
Use cpu_family instead of cpu in meson config, which is 'more
correct' when building for a single cpu instead of multilib. -
Make arm sample interrupt vector work with clang
-
Use __inline instead of inline in published headers to allow
compiling with -ansi -
Make 'naked' RISC-V _start function contain only asm
statements as required by clang (and recommended by gcc). -
Use -msave-restore in sample RISC-V cross-compile
configuration. This saves text space.
Picolibc version 1.4
This release was focused on cleaning up the copyright and license
information.
-
Copyright information should now be present in every source file.
-
License information, where it could be inferred from the
repository, was added to many files. -
4-clause BSD licenses were changed (with permission) to 3-clause
-
Fix RISC-V ieeefp.h exception bits
-
Merge past newlib 3.2.0
-
Add PICOLIBC_TLS preprocessor define when the library has TLS support
Picolibc version 1.3
This release now includes tests, and fixes bugs found by them.
-
ESP8266 support added, thanks to Jonathan McDowell.
-
Numerous test cases from newlib have been fixed, and
precision requirements adjusted so that the library now
passes its own test suite on x86, RISC-V and ARM. -
String/number conversion bug fixes. This includes fcvt/ecvt/gcvt
shared with newlib and tinystdio printf/scanf -
A few RISC-V ABI fixes, including setting the TLS base correctly,
compiling with -mcmodel=medany, and enabling the FPU for libraries
built to use it. -
Semihosting updates, including adding unlink, kill and getpid
(which are used by some tests).
Picolibc version 1.2
This release includes important fixes in picolibc.ld and more
semihosting support.
-
File I/O and clock support for semihosting. This enables fopen/fdopen
support in tinystdio along with an API to fetch a real time clock
value. -
Fix picolibc.ld to not attempt to use redefined symbols for memory
space definitions. These re-definitions would fail and the default
values be used for system memory definitions. Instead, just use
the ? : operators each place the values are needed. Linker scripts
continue to mystify. -
Expose library definitions in 'picolibc.h', instead of 'newlib.h'
and '_newlib_version.h' -
Define HAVE_SEMIHOST when semihosting support is available. This
lets the 'hello-world' example do some semihost specific things.
Picolibc version 1.1
A minor update from 1.0, this release includes:
-
semihost support. This adds console I/O and exit(3) support on ARM
and RISC-V hosts using the standard semihosting interfaces. -
Posix I/O support in tinystdio. When -Dposix-io=true is included
in the meson command line (which is the default), tinystdio adds
support for fopen and fdopen by using malloc, open, close, read,
write and lseek. If -Dposix-console=true is also passed to meson,
then picolibc will direct stdin/stdout/stderr to the posix
standard file descriptors (0, 1, 2). -
Merge recent upstream newlib code. This brings picolibc up to date
with current newlib sources. -
Hello world example. This uses a simple Makefile to demonstrate
how to us picolibc when installed for ARM and RISC-V embedded
processors. The resulting executables can be run under qemu. -
Remove newlib/libm/mathfp directory. This experimental code never
worked correctly anyways.
Picolibc version 1.0
This is the first release of picolibc. Major changes from newlib
include:
-
Remove all non-BSD licensed code. None of it was used in building
the embedded library, and removing it greatly simplifies the
license situation. -
Move thread-local values to native TLS mechanism
-
Add smaller stdio from avr-libc, which is enabled by default
-
Switch build system to meson. This has two notable benefits; the first
is that building the library is much faster, the second is that
it isolates build system changes from newlib making merging of
newlib changes much easier. -
Add simple startup code. This can be used in environments that
don't have complicated requirements, allowing small applications
to avoid needing to figure this out.