ae574ae3 | 07-Aug-2024 |
Thomas Weißschuh <linux@weissschuh.net> |
selftests/nolibc: add support for LLVM= parameter
Makefile.include can modify CC and CFLAGS for usage with clang. Make use of it.
Makefile.include is currently used to handle the O= variable. This
selftests/nolibc: add support for LLVM= parameter
Makefile.include can modify CC and CFLAGS for usage with clang. Make use of it.
Makefile.include is currently used to handle the O= variable. This is incompatible with the LLVM= handling as for O= it has to be included as early as possible, while for LLVM= it needs to be included after CFLAGS are set up.
To avoid this incompatibility, switch the O= handling to custom logic.
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20240807-nolibc-llvm-v2-10-c20f2f5fc7c2@weissschuh.net Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
1a1200b6 | 07-Aug-2024 |
Thomas Weißschuh <linux@weissschuh.net> |
selftests/nolibc: determine $(srctree) first
The nolibc-test Makefile includes various other Makefiles from the tree. At first these are included with relative paths like "../../../build/Build.inclu
selftests/nolibc: determine $(srctree) first
The nolibc-test Makefile includes various other Makefiles from the tree. At first these are included with relative paths like "../../../build/Build.include" but as soon as $(srctree) is set up, the inclusions use that instead to build full paths.
To keep the style of inclusions consistent, perform the setup $(srctree) as early as possible and use it for all inclusions.
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20240807-nolibc-llvm-v2-9-c20f2f5fc7c2@weissschuh.net Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
f1a58f61 | 07-Aug-2024 |
Thomas Weißschuh <linux@weissschuh.net> |
selftests/nolibc: avoid passing NULL to printf("%s")
Clang on higher optimization levels detects that NULL is passed to printf("%s") and warns about it. While printf() from nolibc gracefully handles
selftests/nolibc: avoid passing NULL to printf("%s")
Clang on higher optimization levels detects that NULL is passed to printf("%s") and warns about it. While printf() from nolibc gracefully handles that NULL, it is undefined behavior as per POSIX, so the warning is reasonable. Avoid the warning by transforming NULL into a non-NULL placeholder.
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20240807-nolibc-llvm-v2-8-c20f2f5fc7c2@weissschuh.net Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
ddae1d7f | 07-Aug-2024 |
Thomas Weißschuh <linux@weissschuh.net> |
selftests/nolibc: report failure if no testcase passed
When nolibc-test is so broken, it doesn't even start, don't report success.
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org> Acked-by: Will
selftests/nolibc: report failure if no testcase passed
When nolibc-test is so broken, it doesn't even start, don't report success.
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20240807-nolibc-llvm-v2-7-c20f2f5fc7c2@weissschuh.net Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
d20d0b10 | 26-Apr-2024 |
Thomas Weißschuh <linux@weissschuh.net> |
tools/nolibc: implement strerror()
strerror() is commonly used. For example in kselftest which currently needs to do an #ifdef NOLIBC to handle the lack of strerror().
Keep it simple and reuse the
tools/nolibc: implement strerror()
strerror() is commonly used. For example in kselftest which currently needs to do an #ifdef NOLIBC to handle the lack of strerror().
Keep it simple and reuse the output format of perror() for strerror().
Acked-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
582facfa | 26-Apr-2024 |
Thomas Weißschuh <linux@weissschuh.net> |
selftests/nolibc: introduce condition to run tests only on nolibc
Some tests only make sense on nolibc. To avoid gaps in the test numbers do to inline "#ifdef NOLIBC", add a condition to formally sk
selftests/nolibc: introduce condition to run tests only on nolibc
Some tests only make sense on nolibc. To avoid gaps in the test numbers do to inline "#ifdef NOLIBC", add a condition to formally skip these tests.
Acked-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
0cf24d36 | 25-Apr-2024 |
Thomas Weißschuh <linux@weissschuh.net> |
tools/nolibc: implement strtol() and friends
The implementation always works on uintmax_t values.
This is inefficient when only 32bit are needed. However for all functions this only happens for str
tools/nolibc: implement strtol() and friends
The implementation always works on uintmax_t values.
This is inefficient when only 32bit are needed. However for all functions this only happens for strtol() on 32bit platforms.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20240425-nolibc-strtol-v1-2-bfeef7846902@weissschuh.net
show more ...
|
774e6ef2 | 23-Apr-2024 |
Thomas Weißschuh <linux@weissschuh.net> |
selftests/nolibc: run-tests.sh: use -Werror by default
run-tests.sh hides the output from the compiler unless the compilation fails. To recognize newly introduced warnings use -Werror by default.
A
selftests/nolibc: run-tests.sh: use -Werror by default
run-tests.sh hides the output from the compiler unless the compilation fails. To recognize newly introduced warnings use -Werror by default.
Also add a switch to disable -Werror in case the warnings are expected.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20240423-nolibc-werror-v1-1-e6f0bd66eb45@weissschuh.net
show more ...
|
6cada284 | 24-Apr-2024 |
Thomas Weißschuh <linux@weissschuh.net> |
selftests/nolibc: disable brk()/sbrk() tests on musl
On musl calls to brk() and sbrk() always fail with ENOMEM. Detect this and skip the tests on musl.
Tested on glibc 2.39 and musl 1.2.5 in additi
selftests/nolibc: disable brk()/sbrk() tests on musl
On musl calls to brk() and sbrk() always fail with ENOMEM. Detect this and skip the tests on musl.
Tested on glibc 2.39 and musl 1.2.5 in addition to nolibc.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20240424-nolibc-musl-brk-v1-1-b49882dd9a93@weissschuh.net
show more ...
|
0adab2b6 | 14-Apr-2024 |
Thomas Weißschuh <linux@weissschuh.net> |
tools/nolibc: add support for uname(2)
All supported kernels are assumed to use struct new_utsname. This is validated in test_uname().
uname(2) can for example be used in ksft_min_kernel_version()
tools/nolibc: add support for uname(2)
All supported kernels are assumed to use struct new_utsname. This is validated in test_uname().
uname(2) can for example be used in ksft_min_kernel_version() from the kernels selftest framework.
Link: https://lore.kernel.org/lkml/20240412123536.GA32444@redhat.com/ Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
d543d9dd | 22-Nov-2023 |
Thomas Weißschuh <linux@weissschuh.net> |
selftests/nolibc: disable coredump via setrlimit
qemu-user does has its own implementation of coredumping. That implementation does not respect the call to prctl(PR_SET_DUMPABLE, 0) in run_protectio
selftests/nolibc: disable coredump via setrlimit
qemu-user does has its own implementation of coredumping. That implementation does not respect the call to prctl(PR_SET_DUMPABLE, 0) in run_protection(). This leads to a coredump for every test run under qemu-user.
Use also setrlimit() to inhibit coredump creation which is respected by qemu-user.
Link: https://lore.kernel.org/qemu-devel/20231115-qemu-user-dumpable-v1-2-edbe7f0fbb02@t-8ch.de/ Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/lkml/20231123-nolibc-rlimit-v1-3-a428b131de2a@weissschuh.net/ Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
a0bb5f88 | 22-Nov-2023 |
Thomas Weißschuh <linux@weissschuh.net> |
tools/nolibc: add support for getrlimit/setrlimit
The implementation uses the prlimit64 systemcall as that is available on all architectures.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
tools/nolibc: add support for getrlimit/setrlimit
The implementation uses the prlimit64 systemcall as that is available on all architectures.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/lkml/20231123-nolibc-rlimit-v1-2-a428b131de2a@weissschuh.net/ Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
825f4047 | 25-Nov-2023 |
Thomas Weißschuh <linux@weissschuh.net> |
tools/nolibc: drop duplicated testcase ioctl_tiocinq
The same testcase is present on the line above.
Fixes: b4844fa0bdb4 ("selftests/nolibc: implement a few tests for various syscalls") Signed-off-
tools/nolibc: drop duplicated testcase ioctl_tiocinq
The same testcase is present on the line above.
Fixes: b4844fa0bdb4 ("selftests/nolibc: implement a few tests for various syscalls") Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
b9e64724 | 22-Nov-2023 |
Thomas Weißschuh <linux@weissschuh.net> |
selftests/nolibc: make result alignment more robust
Move the check of the existing length into the function so it can't be forgotten by the caller.
Also hardcode the padding character as only space
selftests/nolibc: make result alignment more robust
Move the check of the existing length into the function so it can't be forgotten by the caller.
Also hardcode the padding character as only spaces are ever used.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
54410245 | 08-Nov-2023 |
Thomas Weißschuh <linux@weissschuh.net> |
tools/nolibc: mips: add support for PIC
MIPS requires some extra instructions to set up the $gp register for the with a pointer to the global data area.
This isn't needed for non-PIC builds, but th
tools/nolibc: mips: add support for PIC
MIPS requires some extra instructions to set up the $gp register for the with a pointer to the global data area.
This isn't needed for non-PIC builds, but this patch enables the code unconditionally to prevent bitrot.
Also enable PIC in one of the test configurations for ongoing validation.
Link: https://lore.kernel.org/r/20231108-nolibc-pic-v2-1-4fb0d6284757@weissschuh.net Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
8bcf9a48 | 15-Sep-2077 |
Thomas Weißschuh <linux@weissschuh.net> |
selftests/nolibc: run-tests.sh: enable testing via qemu-user
qemu-user is faster than a full system test.
Link: https://lore.kernel.org/r/20770915-nolibc-run-user-v1-2-3caec61726dc@weissschuh.net S
selftests/nolibc: run-tests.sh: enable testing via qemu-user
qemu-user is faster than a full system test.
Link: https://lore.kernel.org/r/20770915-nolibc-run-user-v1-2-3caec61726dc@weissschuh.net Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
d7233e2b | 15-Sep-2077 |
Thomas Weißschuh <linux@weissschuh.net> |
selftests/nolibc: introduce QEMU_ARCH_USER
While ppc64le shares the same executable with regular ppc64 the user variant needs has a dedicated executable. Introduce a new QEMU_ARCH_USER Makefile vari
selftests/nolibc: introduce QEMU_ARCH_USER
While ppc64le shares the same executable with regular ppc64 the user variant needs has a dedicated executable. Introduce a new QEMU_ARCH_USER Makefile variable to accommodate that.
Fixes: 17362f3d0bd3 ("selftests/nolibc: use qemu-system-ppc64 for ppc64le") Link: https://lore.kernel.org/r/20770915-nolibc-run-user-v1-1-3caec61726dc@weissschuh.net Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
07f679b5 | 05-Nov-2023 |
Thomas Weißschuh <linux@weissschuh.net> |
selftests/nolibc: fix testcase status alignment
Center-align all possible status reports. Before OK and FAIL were center-aligned in relation to each other but SKIPPED and FAILED would be left-aligne
selftests/nolibc: fix testcase status alignment
Center-align all possible status reports. Before OK and FAIL were center-aligned in relation to each other but SKIPPED and FAILED would be left-aligned.
Before:
7 environ_addr = <0x7fffef3e7c50> [OK] 8 environ_envp = <0x7fffef3e7c58> [FAIL] 9 environ_auxv [SKIPPED] 10 environ_total [SKIPPED] 11 environ_HOME = <0x7fffef3e99bd> [OK] 12 auxv_addr [SKIPPED] 13 auxv_AT_UID = 1000 [OK]
After:
7 environ_addr = <0x7ffff13b00a0> [OK] 8 environ_envp = <0x7ffff13b00a8> [FAIL] 9 environ_auxv [SKIPPED] 10 environ_total [SKIPPED] 11 environ_HOME = <0x7ffff13b19bd> [OK] 12 auxv_addr [SKIPPED] 13 auxv_AT_UID = 1000 [OK]
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
show more ...
|
3ab1e9db | 20-Oct-2023 |
Thomas Weißschuh <linux@weissschuh.net> |
selftests/nolibc: extraconfig support
Allow some postprocessing of defconfig files.
Suggested-by: Zhangjin Wu <falcon@tinylab.org> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: W
selftests/nolibc: extraconfig support
Allow some postprocessing of defconfig files.
Suggested-by: Zhangjin Wu <falcon@tinylab.org> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|
bb503f5f | 20-Oct-2023 |
Thomas Weißschuh <linux@weissschuh.net> |
selftests/nolibc: explicitly specify ABI for MIPS
More ABIs exist, for better clarity specify it explicitly everywhere.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarrea
selftests/nolibc: explicitly specify ABI for MIPS
More ABIs exist, for better clarity specify it explicitly everywhere.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu>
show more ...
|