| 1f421ddf | 30-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: use poll-related definitions from UAPI headers
The UAPI headers already provide definitions for these symbols. Using them makes the code shorter, more robust and compatible with applic
tools/nolibc: use poll-related definitions from UAPI headers
The UAPI headers already provide definitions for these symbols. Using them makes the code shorter, more robust and compatible with applications using linux/poll.h directly.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20250430-poll-v1-2-44b5ceabdeee@linutronix.de Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
| dc2c656e | 30-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: move poll() to poll.h
This is the location regular userspace expects the definition.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.e
tools/nolibc: move poll() to poll.h
This is the location regular userspace expects the definition.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20250430-poll-v1-1-44b5ceabdeee@linutronix.de Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
| 66a4f9bb | 27-Apr-2025 |
Daniel Palmer <daniel@0x0f.com> |
tools/nolibc: Add m68k support
Add nolibc support for m68k. Should be helpful for nommu where linking libc can bloat even hello world to the point where you get an OOM just trying to load it.
Signe
tools/nolibc: Add m68k support
Add nolibc support for m68k. Should be helpful for nommu where linking libc can bloat even hello world to the point where you get an OOM just trying to load it.
Signed-off-by: Daniel Palmer <daniel@thingy.jp> Link: https://lore.kernel.org/r/20250426224738.284874-1-daniel@0x0f.com Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
| 3785289f | 24-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: include nolibc.h early from all header files
Inclusion of any nolibc header file should also bring all other headers. On the other hand it should also be possible to include any nolibc
tools/nolibc: include nolibc.h early from all header files
Inclusion of any nolibc header file should also bring all other headers. On the other hand it should also be possible to include any nolibc header files in any order.
Currently this is implemented by including the catch-all nolibc.h after the headers own definitions. This is problematic if one nolibc header depends on another one. The first header has to include the other one before defining any symbols. That in turn will include the rest of nolibc while the current header has not defined anything yet. If any other part of nolibc depends on definitions from the current header, errors are encountered. This is already the case today. Effectively nolibc can only be included in the order of nolibc.h.
Restructure the way "nolibc.h" is included. Move it to the beginning of the header files and before the include guards. Now any header will behave exactly like "nolibc.h" while the include guards prevent any duplicate definitions.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20250424-nolibc-header-check-v1-2-011576b6ed6f@linutronix.de
show more ...
|
| a6a054c8 | 24-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: add target to check header usability
Each nolibc header should be valid for inclusion irrespective of any special ordering requirements.
Add a new make target, based on the old kbuild
tools/nolibc: add target to check header usability
Each nolibc header should be valid for inclusion irrespective of any special ordering requirements.
Add a new make target, based on the old kbuild "make header_check" target to validate this requirement.
For now the check fails, but the following commits will fix the issues.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20250424-nolibc-header-check-v1-1-011576b6ed6f@linutronix.de
show more ...
|
| e90ce42e | 11-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: implement width padding in printf()
printf can pad each argument to a certain width. Implement this for compatibility with the kselftest harness. Currently only padding with spaces is
tools/nolibc: implement width padding in printf()
printf can pad each argument to a certain width. Implement this for compatibility with the kselftest harness. Currently only padding with spaces is supported.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
| ed45d24c | 11-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: add snprintf() and friends
Add more of the printf() functions.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu> |
| 9f4a2e28 | 11-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: allow limiting of printf destination size
snprintf() allows limiting the output buffer, while still returning the number of all bytes that would have been written. Implement the limita
tools/nolibc: allow limiting of printf destination size
snprintf() allows limiting the output buffer, while still returning the number of all bytes that would have been written. Implement the limitation logic in preparation for snprintf().
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
| f7b3eeff | 11-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: allow different write callbacks in printf
Decouple the formatting logic from the writing logic to later enable writing straight to a buffer in sprintf().
Signed-off-by: Thomas Weißsch
tools/nolibc: allow different write callbacks in printf
Decouple the formatting logic from the writing logic to later enable writing straight to a buffer in sprintf().
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
| bae3cd70 | 11-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: add getopt()
Introduce a getopt() implementation based on the one from musl. The only deviations are adaption to the kernel coding style and nolibc infrastructure and removal of multi-
tools/nolibc: add getopt()
Introduce a getopt() implementation based on the one from musl. The only deviations are adaption to the kernel coding style and nolibc infrastructure and removal of multi-byte support.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
| 5197b7b8 | 11-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: add dprintf() and vdprintf()
dprintf() and vdprintf() are printf() variants printing directly into a filedescriptor. As FILE in nolibc is based directly on filedescriptors, the impleme
tools/nolibc: add dprintf() and vdprintf()
dprintf() and vdprintf() are printf() variants printing directly into a filedescriptor. As FILE in nolibc is based directly on filedescriptors, the implementation is trivial.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
| 0c89abf5 | 11-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: implement waitpid() in terms of waitid()
The old wait4() syscall used by waitpid() before is not available everywhere. Switch to the waitid() syscall which is the new replacement.
Sig
tools/nolibc: implement waitpid() in terms of waitid()
The old wait4() syscall used by waitpid() before is not available everywhere. Switch to the waitid() syscall which is the new replacement.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
| 67fe525e | 11-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: add setpgrp()
setpgrp() is defined to be identical to setpgid(0, 0).
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu> |
| 7b11531e | 11-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: add _exit()
_exit() is the faster variant of exit(), skipping all cleanup actions. As nolibc does not perform any cleanup anyways, the implementation is trivial.
Signed-off-by: Thomas
tools/nolibc: add _exit()
_exit() is the faster variant of exit(), skipping all cleanup actions. As nolibc does not perform any cleanup anyways, the implementation is trivial.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
| 9b070d97 | 11-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: add tolower() and toupper()
The kselftest harness uses these functions.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu> |
| 4de88a88 | 11-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: use ppoll_time64 if available
riscv32 does not have any of the older poll systemcalls. Use ppoll_time64 instead.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acke
tools/nolibc: use ppoll_time64 if available
riscv32 does not have any of the older poll systemcalls. Use ppoll_time64 instead.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
| 248ddc80 | 11-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: use pselect6_time64 if available
riscv32 does not have any of the older select systemcalls. Use pselect6_time64 instead. poll() is also used to implement sleep().
Signed-off-by: Thoma
tools/nolibc: use pselect6_time64 if available
riscv32 does not have any of the older select systemcalls. Use pselect6_time64 instead. poll() is also used to implement sleep().
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
| e5407c08 | 11-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: use intmax definitions from compiler
The printf format checking in the compiler uses the intmax types from the compiler, not libc. This can lead to compiler errors.
Instead use the ty
tools/nolibc: use intmax definitions from compiler
The printf format checking in the compiler uses the intmax types from the compiler, not libc. This can lead to compiler errors.
Instead use the types already provided by the compiler.
Example issue with clang 19 for arm64:
nolibc-test.c:30:2: error: format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'uintmax_t' (aka 'unsigned long long') [-Werror,-Wformat]
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
| 4c99fbc6 | 11-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: handle intmax_t/uintmax_t in printf
In nolibc intmax_t and uintmax_t are always the same as (unsigned) long long/uint64_t as 128bit numbers are not supported. Even libcs that do suppor
tools/nolibc: handle intmax_t/uintmax_t in printf
In nolibc intmax_t and uintmax_t are always the same as (unsigned) long long/uint64_t as 128bit numbers are not supported. Even libcs that do support 128bit numbers often fix intmax_t to 64bit as it is used in ABIs and any change would break those.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
| 6d1724ec | 16-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: move wait() and friends to sys/wait.h
This is the location regular userspace expects these definitions.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Wil
tools/nolibc: move wait() and friends to sys/wait.h
This is the location regular userspace expects these definitions.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20250416-nolibc-split-sys-v1-10-a069a3f1d145@linutronix.de Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
| ffb94910 | 16-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: add sys/types.h shim
This is the location regular userspace expects the header.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu> Li
tools/nolibc: add sys/types.h shim
This is the location regular userspace expects the header.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20250416-nolibc-split-sys-v1-9-a069a3f1d145@linutronix.de Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
| face777a | 16-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: move gettimeofday() to sys/time.h
This is the location regular userspace expects this definition.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tar
tools/nolibc: move gettimeofday() to sys/time.h
This is the location regular userspace expects this definition.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20250416-nolibc-split-sys-v1-8-a069a3f1d145@linutronix.de Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
| 0fd55773 | 16-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: move syscall() to sys/syscall.h
This is the location regular userspace expects the definition.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarrea
tools/nolibc: move syscall() to sys/syscall.h
This is the location regular userspace expects the definition.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20250416-nolibc-split-sys-v1-7-a069a3f1d145@linutronix.de Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
| c6e6c2c4 | 16-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: move stat() and friends to sys/stat.h
This is the location regular userspace expects these definitions.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Wil
tools/nolibc: move stat() and friends to sys/stat.h
This is the location regular userspace expects these definitions.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20250416-nolibc-split-sys-v1-6-a069a3f1d145@linutronix.de Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
| cce27316 | 16-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
tools/nolibc: move mmap() and friends to sys/mman.h
This is the location regular userspace expects these definitions.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Wil
tools/nolibc: move mmap() and friends to sys/mman.h
This is the location regular userspace expects these definitions.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20250416-nolibc-split-sys-v1-5-a069a3f1d145@linutronix.de Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|