1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 07:21:18 +01:00

3 Commits

Author SHA1 Message Date
Marian Buschsieweke
3415656a4a
sys/newlib_syscalls_default: wrap newlib's assert implementation
This avoids inconsistent output when external code gets linked in that
directly links against newlib's assert implementation (e.g. binary blobs
or packages that do not add `core/lib/include` to the include paths).

This also greatly benefits wrapping printf, as newlib's `__assert_func()`
directly links to internal printf functions of newlib.

Co-authored-by: crasbe <crasbe@gmail.com>
2025-08-21 12:08:10 +02:00
Marian Buschsieweke
7caf2066d8
pkg/mpaland-printf: fix overriding printf with printf_float
This makes sure that newlib's printf is correctly overridden by:

1. Adding wrappers for some more obscure printf() variants
2. Forcing a compilation failure when newlib's stdio is still linked in
   while mpaland-printf is used
3. Not adding `-u _printf_float` to the linker flags when mpaland-printf
   is used.
2025-04-26 15:28:17 +02:00
Marian Buschsieweke
6d8233fa24
pkg/mpaland-printf: Add alternative stdio as package
This packs the stdio implementation from [1] as alternative to
what the used standard C lib provides with the intent to provide a
thread-safe, smaller, and more feature-complete alternative on
newlib targets.

Compared to `newlib_nano` this reduces `.text` by a bit more than 200 B
while adding support for standard format specifiers such as `RPIu8`,
`PRIu16`, `PRIu64`, `%z`, and `%t`.

Note that `newlib_nano`'s stdio can be thread-safe in reentrant mode
at the cost of RAM (per thread) and latency. Especially the increase
in latency can be prohibitive when real time requirements need to be
met.

[1]: https://github.com/mpaland/printf
2025-04-24 11:46:09 +02:00