When building with a multiarch-capable compiler, like those provided by
common distributions the -m32 argument is required to build 32bit code.
Wrap it in cc-option in case the compiler is not multiarch-capable.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 1
Signed-off-by: Thomas Weißschuh
---
Thomas Weißschuh (4):
selftests/nolibc: allow building i386 with multiarch compiler
tools/nolibc: avoid unused parameter warnings for ENOSYS fallbacks
tools/nolibc: don't define new syscall number
tools/nolibc: automatically d
The ENOSYS fallback code does not use its functions parameters.
This can lead to compiler warnings about unused parameters.
Explicitly avoid these warnings.
Signed-off-by: Thomas Weißschuh
---
tools/include/nolibc/sys.h | 31 +++
1 file changed, 31 insertions
We can automatically detect if pselect6 is needed or not from the kernel
headers. This removes the need to manually specify it.
Signed-off-by: Thomas Weißschuh
---
tools/include/nolibc/arch-aarch64.h | 3 ---
tools/include/nolibc/arch-loongarch.h | 4 +---
tools/include/nolibc/arch-riscv.h
All symbols created by nolibc are also visible to user code.
Syscall constants are expected to come from the kernel headers and
should not be made up by nolibc.
Refactor the logic to avoid defining syscall numbers.
Also the new code is easier to understand.
Signed-off-by: Thomas Weißschuh
linking the initramfs into the kernel assemble it manually
and pass it explicitly to qemu.
This avoids all of the kernel relinks.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 47 +
1 file changed, 24 insertions(+), 23 deletions
.
With a bit of Makefile-shuffling the relinking can be avoided.
Signed-off-by: Thomas Weißschuh
---
Thomas Weißschuh (3):
kbuild: add toplevel target for usr/gen_init_cpio
selftests/nolibc: don't embed initramfs into kernel image
selftests/nolibc: drop target "rerun&q
Now that the target "run" does not relink the kernel all the time
anymore it is much faster and we don't need "rerun" anymore.
Signed-off-by: Thomas Weißschuh
---
Willy:
This is an optional commit, "rerun" is still a bit faster than "run".
Also
The nolibc testsuite wants to generate an initrams without linking it
into the kernel for which it needs access to gen_init_cpio.
Add a new toplevel target for it so it can be built standalone.
Signed-off-by: Thomas Weißschuh
---
Kbuild maintainers:
If there is a way that does not require
On 2023-09-17 04:58:51+0200, Willy Tarreau wrote:
> On Thu, Sep 14, 2023 at 06:01:18PM +0200, Thomas Weißschuh wrote:
> > The ENOSYS fallback code does not use its functions parameters.
> > This can lead to compiler warnings about unused parameters.
> >
> > Expl
On 2023-09-17 05:22:19+0200, Willy Tarreau wrote:
> On Sat, Sep 16, 2023 at 09:13:26AM +0200, Thomas Weißschuh wrote:
> > Currently the nolibc testsuite embeds the test executable into a kernel
> > image with CONFIG_INITRAMFS_SOURCE.
> > This forces a full kernel reli
On 2023-09-17 11:48:27+0200, Willy Tarreau wrote:
> [..]
> > Maybe the macro-equivalent of this?
> >
> > static inline int __nolibc_enosys(...)
> > {
> > return -ENOSYS;
> > }
> >
> > The only-vararg function unfortunately needs C23 so we can't use it.
> >
> > It's clear to the users that thi
linking the initramfs into the kernel assemble it manually
and pass it explicitly to qemu.
This avoids all of the kernel relinks.
Signed-off-by: Thomas Weißschuh
---
Currently the nolibc testsuite embeds the test executable into a kernel
image with CONFIG_INITRAMFS_SOURCE.
This forces a full kernel
Signed-off-by: Thomas Weißschuh
---
Changes in v2:
- Replace manual casts to (void) with __nolibc_enosys helpers
- Link to v1:
https://lore.kernel.org/r/20230914-nolibc-syscall-nr-v1-0-e50df410d...@weissschuh.net
---
Thomas Weißschuh (4):
selftests/nolibc: allow building i386 with
: Thomas Weißschuh
---
tools/include/nolibc/sys.h | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h
index 8389820e1928..f05144e46b67 100644
--- a/tools/include/nolibc/sys.h
+++ b/tools/include/nolibc/sys.h
@@ -938,11
The ENOSYS fallback code does not use its functions parameters.
This can lead to compiler warnings about unused parameters.
Explicitly avoid these warnings.
Signed-off-by: Thomas Weißschuh
---
tools/include/nolibc/sys.h | 44 +++-
1 file changed, 27
We can automatically detect if pselect6 is needed or not from the kernel
headers. This removes the need to manually specify it.
Acked-by: Willy Tarreau
Signed-off-by: Thomas Weißschuh
---
tools/include/nolibc/arch-aarch64.h | 3 ---
tools/include/nolibc/arch-loongarch.h | 4 +---
tools
When building with a multiarch-capable compiler, like those provided by
common distributions the -m32 argument is required to build 32bit code.
Wrap it in cc-option in case the compiler is not multiarch-capable.
Acked-by: Willy Tarreau
Signed-off-by: Thomas Weißschuh
---
tools/testing
On 2023-09-18 18:19:15+0200, Willy Tarreau wrote:
> Hi Thomas,
>
> On Sun, Sep 17, 2023 at 05:36:17PM +0200, Thomas Weißschuh wrote:
> > The ENOSYS fallback code does not use its functions parameters.
> > This can lead to compiler warnings about unused parameters.
> >
5747 nolibc-test.after
21970 104 88 221625692 nolibc-test.after-only-crt.h-changes
The sections are defined by [0].
[0] https://refspecs.linuxfoundation.org/elf/gabi4+/ch5.dynamic.html
Signed-off-by: Thomas Weißschuh
---
Note:
This is only an RFC as I'm not 100% sure it b
Hi Willy,
On 2023-10-07 08:50:25+0200, Willy Tarreau wrote:
> On Thu, Oct 05, 2023 at 06:45:07PM +0200, Thomas Weißschuh wrote:
> > With the startup code moved to C, implementing support for
> > constructors and deconstructors is fairly easy to implement.
> [..]
> > di
On 2023-10-07 10:30:35+0200, Willy Tarreau wrote:
> On Sat, Oct 07, 2023 at 09:28:45AM +0200, Thomas Weißschuh wrote:
> > > In the past I learned the hard way that you can never trust the execution
> > > order of constructors, so if you're unlucky above you could very we
5747 nolibc-test.after
21970 104 88 221625692 nolibc-test.after-only-crt.h-changes
The sections are defined by [0].
[0] https://refspecs.linuxfoundation.org/elf/gabi4+/ch5.dynamic.html
Signed-off-by: Thomas Weißschuh
---
Changes in v2:
- Drop RFC status.
- Add comment to
("selftests/nolibc: add testcases for startup code")
Cc: sta...@vger.kernel.org
Signed-off-by: Thomas Weißschuh
---
Note:
This should probably also make it into 6.6.
---
tools/testing/selftests/nolibc/nolibc-test.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/testing/selfte
On 2023-10-07 12:36:20+0200, Willy Tarreau wrote:
> On Sat, Oct 07, 2023 at 12:18:55PM +0200, Thomas Weißschuh wrote:
> > The test will not work for systems with pagesize != 4096 like aarch64
> > and some others.
> >
> > Other testcases are already tes
s getauxval() in general.
> > * test_getpagesize() tests pagesize() which directly calls
> > getauxval(AT_PAGESZ).
> >
> > Fixes: 48967b73f8fe ("selftests/nolibc: add testcases for startup code")
> > Cc: sta...@vger.kernel.org
> > Signed-off-by: Thomas Weißschuh
> [..]
qemu-system-ppc64 can handle both big and little endian kernels.
While some setups, like Debian, provide a symlink to execute
qemu-system-ppc64 as qemu-system-ppc64le, others, like ArchLinux, do not.
So always use qemu-system-ppc64 directly.
Signed-off-by: Thomas Weißschuh
---
tools/testing
about 'file not found' is better than a hanging
test without output that can never succeed.
Link:
https://lore.kernel.org/loongarch/1738d60a-df3a-4102-b1da-d16a29b6e...@t-8ch.de/
Signed-off-by: Thomas Weißschuh
---
Note: I'm wondering how this worked for anybody else.
---
too
It is easier to recognize paths from their well-known location in the
source tree than having to resolve the relative path in ones head.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools
74.git.fal...@tinylab.org/
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 18 ++
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/nolibc/Makefile
b/tools/testing/selftests/nolibc/Makefile
index 598d53c5cb7b..21
uot;selftests/nolibc: use qemu-system-ppc64 also for ppc64le" was already
submitted standalone but I included it here again for easier testing and
review.
Signed-off-by: Thomas Weißschuh
---
Thomas Weißschuh (5):
selftests/nolibc: use qemu-system-ppc64 also for ppc64le
se
qemu-system-ppc64 can handle both big and little endian kernels.
While some setups, like Debian, provide a symlink to execute
qemu-system-ppc64 as qemu-system-ppc64le, others, like ArchLinux, do not.
So always use qemu-system-ppc64 directly.
Signed-off-by: Thomas Weißschuh
---
tools/testing
This new target generates a .config if none exists yet.
Also drop the defconfig target with its hidden call to 'mrproper' which
is fairly invasive.
If users want to overwrite their kernel existing kernel configuration
they can do so easily from the toplevel directory.
Signed-off-
Oct 22, 2023 11:21:16 Willy Tarreau :
> On Tue, Oct 10, 2023 at 02:33:57PM +0200, Thomas Weißschuh wrote:
>> qemu for LoongArch does not work properly with direct kernel boot.
>> The kernel will panic during initialization and hang without any output.
>>
>> When boo
Oct 22, 2023 11:31:32 Willy Tarreau :
> On Tue, Oct 10, 2023 at 02:33:59PM +0200, Thomas Weißschuh wrote:
>> Out of tree builds are much more convenient when building for multiple
>> architectures or configurations in parallel.
>>
>> Only absolute O= parameters are su
Oct 22, 2023 11:37:05 Willy Tarreau :
> On Tue, Oct 10, 2023 at 02:34:00PM +0200, Thomas Weißschuh wrote:
>> This new target generates a .config if none exists yet.
>>
>> Also drop the defconfig target with its hidden call to 'mrproper' which
>> is fairly in
It is easier to recognize paths from their well-known location in the
source tree than having to resolve the relative path in ones head.
Acked-by: Willy Tarreau
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions
74.git.fal...@tinylab.org/
Co-developed-by: Zhangjin Wu
Signed-off-by: Zhangjin Wu
Acked-by: Willy Tarreau
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 18 ++
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selfte
about 'file not found' is better than a hanging
test without output that can never succeed.
Link:
https://lore.kernel.org/loongarch/1738d60a-df3a-4102-b1da-d16a29b6e...@t-8ch.de/
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 9 -
1 file change
ges in v2:
- Drop already applied qemu-system-ppc64le patch
- Drop config generation patch
- Add Co-developed-by for out-of-tree patch
- Link to v1:
https://lore.kernel.org/lkml/20231010-nolibc-out-of-tree-v1-0-b6a263859...@weissschuh.net/
---
Thomas Weißschuh (3):
selftests/nolibc: use EFI -b
On 2023-11-02 09:50:38+0100, Willy Tarreau wrote:
> On Tue, Oct 31, 2023 at 09:36:57PM +0100, Thomas Weißschuh wrote:
> > With the out-of-tree builds it's possible do incremental tests fairly fast:
> >
> > time ./run-tests.sh
> > i386: 162 test(s): 162
0 skipped, 0 failed => status:
success
riscv: 162 test(s): 162 passed, 0 skipped, 0 failed => status:
success
s390: 162 test(s): 161 passed, 1 skipped, 0 failed => status:
warning
loongarch: 162 test(s): 161 passed, 1 skipped, 0 failed => status:
warning
Two bugfixes and some minor refactorings of the MIPS support.
Signed-off-by: Thomas Weißschuh
---
Thomas Weißschuh (6):
tools/nolibc: error out on unsupported architecture
tools/nolibc: move MIPS ABI validation into arch-mips.h
selftests/nolibc: use XARCH for MIPS
More ABIs exist, for better clarity specify it explicitly everywhere.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/nolibc/Makefile
b/tools/testing/selftests/nolibc
When installing nolibc to a sysroot arch.h is not used so its ABI check
is bypassed. This makes is possible to compile nolibc with a non O32 ABI
which may build but can not run.
Move the check into arch-mips.h so it will always be evaluated.
Signed-off-by: Thomas Weißschuh
---
tools/include
When an architecture is unsupported arch.h would silently continue.
This leads to a lot of followup errors because my_syscallX() is not
defined and the startup code is missing.
Avoid these confusing errors and fail the build early with a clear
error message and location.
Signed-off-by: Thomas
MIPS has many different configurations prepare the support of additional
ones by moving the build of MIPS to the generic XARCH infrastructure.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 12 +++-
tools/testing/selftests/nolibc/run-tests.sh | 2
Allow some postprocessing of defconfig files.
Suggested-by: Zhangjin Wu
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 6 ++
1 file changed, 6 insertions(+)
diff --git a/tools/testing/selftests/nolibc/Makefile
b/tools/testing/selftests/nolibc/Makefile
index
Allow testing MIPS O32 big endian.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 7 +++
tools/testing/selftests/nolibc/run-tests.sh | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/nolibc/Makefile
b/tools
On 2023-11-05 11:32:27+0100, Willy Tarreau wrote:
> On Sun, Nov 05, 2023 at 11:09:57AM +0100, Thomas Weißschuh wrote:
> > MIPS has many different configurations prepare the support of additional
> > ones by moving the build of MIPS to the generic XARCH infrastructure.
> &g
More ABIs exist, for better clarity specify it explicitly everywhere.
Signed-off-by: Thomas Weißschuh
Acked-by: Willy Tarreau
---
tools/testing/selftests/nolibc/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/nolibc/Makefile
b/tools/testing
Allow some postprocessing of defconfig files.
Suggested-by: Zhangjin Wu
Signed-off-by: Thomas Weißschuh
Acked-by: Willy Tarreau
---
tools/testing/selftests/nolibc/Makefile | 6 ++
1 file changed, 6 insertions(+)
diff --git a/tools/testing/selftests/nolibc/Makefile
b/tools/testing
When installing nolibc to a sysroot arch.h is not used so its ABI check
is bypassed. This makes is possible to compile nolibc with a non O32 ABI
which may build but can not run.
Move the check into arch-mips.h so it will always be evaluated.
Signed-off-by: Thomas Weißschuh
Acked-by: Willy
When an architecture is unsupported arch.h would silently continue.
This leads to a lot of followup errors because my_syscallX() is not
defined and the startup code is missing.
Avoid these confusing errors and fail the build early with a clear
error message and location.
Signed-off-by: Thomas
Two bugfixes and some minor refactorings of the MIPS support.
Signed-off-by: Thomas Weißschuh
---
Changes in v2:
- Use olddefconfig instead of oldconfig
- mipso32{le,be} -> mips32{le,be}
- Link to v1:
https://lore.kernel.org/r/20231105-nolibc-mips-be-v1-0-6c2ad3e50...@weissschuh.net
---
Tho
Allow testing MIPS O32 big endian.
Signed-off-by: Thomas Weißschuh
Acked-by: Willy Tarreau
---
tools/testing/selftests/nolibc/Makefile | 7 +++
tools/testing/selftests/nolibc/run-tests.sh | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests
MIPS has many different configurations prepare the support of additional
ones by moving the build of MIPS to the generic XARCH infrastructure.
Signed-off-by: Thomas Weißschuh
Acked-by: Willy Tarreau
---
tools/testing/selftests/nolibc/Makefile | 12 +++-
tools/testing/selftests
[OK]
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/nolibc-test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c
b/tools/testing/selftests/nolibc/nolibc-test.c
index 2f10541e6f38..e17
On 2023-11-05 15:27:00+0100, Willy Tarreau wrote:
> On Sun, Nov 05, 2023 at 03:22:30PM +0100, Thomas Weißschuh wrote:
> > 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-ali
ation.
Signed-off-by: Thomas Weißschuh
---
tools/include/nolibc/arch-mips.h| 7 ++-
tools/testing/selftests/nolibc/Makefile | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/include/nolibc/arch-mips.h b/tools/include/nolibc/arch-mips.h
index 3a2c76716b83..e9a0184
ation.
Signed-off-by: Thomas Weißschuh
---
Changes in v2:
- Preserver 8-byte alignment of stack pointer
- Link to v1:
https://lore.kernel.org/r/20231108-nolibc-pic-v1-1-9b7a429d5...@weissschuh.net
---
tools/include/nolibc/arch-mips.h| 7 ++-
tools/testing/selftests/nolibc/Makefile | 2
Nov 9, 2023 17:28:45 Konstantin Ryabitsev :
> On Wed, Sep 15, 2077 at 02:13:51AM +0200, Thomas Weißschuh wrote:
>
>
> I'm curious how this happened, especially since this was sent with b4.
My system time was messed up.
I blame systemd-timesyncd.
Migrate part of nolibc-test.c to the new test harness.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/nolibc-test.c | 106 ++-
1 file changed, 56 insertions(+), 50 deletions(-)
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c
b/tools
the test "mmap_munmap_good" fails.
This is a bug in qemu-user and already fixed there on master.
Signed-off-by: Thomas Weißschuh
---
Thomas Weißschuh (3):
selftests/nolibc: add custom test harness
selftests/nolibc: migrate startup tests to new harness
selftests/nolib
Migrate part of nolibc-test.c to the new test harness.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/nolibc-test.c | 74 +++-
1 file changed, 28 insertions(+), 46 deletions(-)
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c
b/tools
in its support for test suites,
the same as google test.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/nolibc-harness.h | 269
1 file changed, 269 insertions(+)
diff --git a/tools/testing/selftests/nolibc/nolibc-harness.h
b/tools/testing
On 2023-11-16 08:16:22+0100, Willy Tarreau wrote:
> Hi Thomas,
>
> On Wed, Nov 15, 2023 at 10:08:19PM +0100, Thomas Weißschuh wrote:
> > The harness provides a framework to write unit tests for nolibc itself
> > and kernel selftests using nolibc.
> >
> > Ad
On 2023-11-16 08:33:27+0100, Willy Tarreau wrote:
> On Wed, Nov 15, 2023 at 10:08:20PM +0100, Thomas Weißschuh wrote:
> > Migrate part of nolibc-test.c to the new test harness.
> >
> > Signed-off-by: Thomas Weißschuh
>
> A few points, mostly questions and food for th
On 2023-11-16 08:48:02+0100, Willy Tarreau wrote:
> On Wed, Nov 15, 2023 at 10:08:21PM +0100, Thomas Weißschuh wrote:
> > Migrate part of nolibc-test.c to the new test harness.
> >
> > Signed-off-by: Thomas Weißschuh
> > ---
> > tools/testing/se
.
Link:
https://lore.kernel.org/qemu-devel/20231115-qemu-user-dumpable-v1-2-edbe7f0fb...@t-8ch.de/
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/nolibc-test.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c
b/tools/testing
The implementation uses the prlimit64 systemcall as that is available on
all architectures.
Signed-off-by: Thomas Weißschuh
---
tools/include/nolibc/sys.h | 38
tools/testing/selftests/nolibc/nolibc-test.c | 29 +
2 files
A future commit will include linux/resource.h, which will conflict with
the private definition of struct rusage in nolibc.
Avoid the conflict by dropping the private definition and use the one
from the UAPI headers.
Signed-off-by: Thomas Weißschuh
---
tools/include/nolibc/types.h | 21
The series adds support for setrlimit/getrlimit.
Mainly to avoid spurious coredumps when running the tests under
qemu-user.
Signed-off-by: Thomas Weißschuh
---
Thomas Weißschuh (3):
tools/nolibc: drop custom definition of struct rusage
tools/nolibc: add support for getrlimit
On 2023-11-26 10:28:28+0100, Willy Tarreau wrote:
> Hi Thomas,
>
> > +int test_rlimit(void)
> > +{
> > + struct rlimit rlim = {
> > + .rlim_cur = 1 << 20,
> > + .rlim_max = 1 << 20,
> > + };
> > + int ret;
> > +
> > + ret = setrlimit(RLIMIT_CORE, &rlim);
> > + if (ret
On 2023-09-11 16:30:25+0200, Willy Tarreau wrote:
> On Mon, Sep 11, 2023 at 04:26:41PM +0200, Thomas Weißschuh wrote:
> > On 2023-09-11 08:04:49+0200, Willy Tarreau wrote:
> > > On Sun, Sep 10, 2023 at 09:29:01PM +0200, Thomas Weißschuh wrote:
> > > > Newer versi
Hi Willy!
On 2023-09-11 08:04:49+0200, Willy Tarreau wrote:
> On Sun, Sep 10, 2023 at 09:29:01PM +0200, Thomas Weißschuh wrote:
> > Newer versions of glibc annotate the poll() function with
> > __attribute__(access) which triggers a compiler warning inside the
> > testcase
As mentioned in the comment, the workaround for
__attribute__((no_stack_protector)) is only necessary on GCC.
Avoid applying the workaround on clang, as clang does not recognize
__attribute__((__optimize__)) and would fail.
Signed-off-by: Thomas Weißschuh
---
tools/include/nolibc/arch-powerpc.h
, so
move that one, too.
Signed-off-by: Thomas Weißschuh
---
tools/include/nolibc/arch-aarch64.h | 4 ++--
tools/include/nolibc/arch-arm.h | 4 ++--
tools/include/nolibc/arch-i386.h | 4 ++--
tools/include/nolibc/arch-loongarch.h | 4 ++--
tools/include/nolibc/arch-mips.h | 4
C for all targets,
so only use it where available.
This also provides compatibility with clang, which recognizes the
"naked" attribute but not the previously used attribute "optimized".
Signed-off-by: Thomas Weißschuh
---
tools/include/nolibc/compiler.h | 9 +
1
s.sh
This series extends this support.
Signed-off-by: Thomas Weißschuh
---
Thomas Weißschuh (12):
tools/nolibc: use clang-compatible asm syntax in arch-arm.h
tools/nolibc: limit powerpc stack-protector workaround to GCC
tools/nolibc: move entrypoint specifics to compiler.h
to
The clang assembler rejects the current syntax.
Switch to a syntax accepted by both GCC and clang.
Signed-off-by: Thomas Weißschuh
---
tools/include/nolibc/arch-arm.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/include/nolibc/arch-arm.h b/tools/include/nolibc
Makefile.
As we want to use its llvm handling in the future, reimplement its
objtree := $(O).
While at it, also move "$(objtree) ?= $(srctree)" for consistency.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 de
Clang on higher optimization levels detects that NULL is passed to
printf("%s") and warns about it.
Avoid the warning.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/nolibc-test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing
If the user specified their own CFLAGS_EXTRA these should not be
overwritten by `-e`.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/run-tests.sh | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/nolibc/run-tests.sh
b/tools
When nolibc-test is so broken, it doesn't even start,
don't report success.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/nolibc/Makefile
b/tools/testing/selfte
The cc-option macro from Build.include is not compatible with clang
cross builds, as it does not respect the "--target" and similar flags,
set up by Mekfile.include.
Provide a custom variant which works correctly.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Ma
The nolibc tests can now be properly built with LLVM.
Expose this through run-tests.sh.
Not all architectures are compatible, add a list for those.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/run-tests.sh | 13 +++--
1 file changed, 11 insertions(+), 2 deletions
Makefile.include can modify CC and CFLAGS for usage with clang.
Make use of it.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/nolibc/Makefile
b/tools/testing/selftests/nolibc/Makefile
Avoid needing relative includes.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests/nolibc/Makefile | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tools/testing/selftests/nolibc/Makefile
b/tools/testing/selftests/nolibc/Makefile
index 46dfbb50fae5
Mirror glibc behavior for compatibility.
Signed-off-by: Thomas Weißschuh
---
tools/include/nolibc/crt.h | 23 ---
tools/testing/selftests/nolibc/nolibc-test.c | 5 +++--
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/tools/include/nolibc
The implementation is limited and only supports numeric arguments.
Signed-off-by: Thomas Weißschuh
---
Thomas Weißschuh (2):
tools/nolibc: add support for [v]sscanf()
Revert "selftests: kselftest: Fix build failure with NOLIBC"
tools/include/nolibc/stdio.h
This reverts commit 16767502aa990cca2cb7d1372b31d328c4c85b40.
Nolibc gained support for uname(2) and sscanf(3) which are the
dependencies of ksft_min_kernel_version().
So re-enable support for ksft_min_kernel_version() under nolibc.
Signed-off-by: Thomas Weißschuh
---
tools/testing/selftests
The implementation is limited and only supports numeric arguments.
Signed-off-by: Thomas Weißschuh
---
tools/include/nolibc/stdio.h | 93
tools/testing/selftests/nolibc/nolibc-test.c | 59 ++
2 files changed, 152 insertions(+)
diff
On 2024-07-31 17:01:09+, Shuah Khan wrote:
> On 7/31/24 12:32, Thomas Weißschuh wrote:
> > The implementation is limited and only supports numeric arguments.
>
> I would like to see more information in here. Why is this needed
> etc. etc.
Ack.
> >
> > S
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.ga32...@redhat.com/
Signed-off-by: Thomas Weißschuh
Hi Willy!
On 2024-04-14 12:56:46+0200, Willy Tarreau wrote:
> On Sun, Apr 14, 2024 at 09:56:23AM +0200, Thomas Weißschuh wrote:
> > All supported kernels are assumed to use struct new_utsname.
> > This is validated in test_uname().
> >
> > uname(2)
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
---
tools/testing/selftests/nolibc/Makefile
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
---
tools/testing/selftests/nolibc/nolibc-test.c | 10 +++---
1 file changed, 7 insertions(+), 3
I wanted to implement sscanf() for ksft_min_kernel_version() and this is
a prerequisite for it.
It's also useful on its own so it gets its own submission.
Signed-off-by: Thomas Weißschuh
---
Thomas Weißschuh (2):
tools/nolibc: add limits for {u,}intmax_t, ulong and {u,}llong
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
---
tools/include/nolibc/stdlib.h| 109
1 - 100 of 154 matches
Mail list logo