mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] tools/nolibc: assorted build fixes for nolibc-test in rare cases
@ 2023-04-02  8:13 Willy Tarreau
  2023-04-02  8:13 ` [PATCH 1/2] tools/nolibc: tests: fix build on non-c99 compliant compilers Willy Tarreau
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Willy Tarreau @ 2023-04-02  8:13 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: linux, v, linux-kernel, Willy Tarreau

Hello Paul,

please find in this series two small build fixes. One of them concerns
two missing include files for building the test against other libc (at
least glibc) since we added the tests for integer types and ranges. The
second one removes a single occurrence of a variable definition inside
the init statement of a for loop that breaks with older compilers which
do not default to c99. They're still convenient to test the portability
of the lib itself and I continue to use them for this purpose.

I consider that there's no rush on this, since these issues only affect
developers adding test cases, who should normally rebase on top of your
dev branch. So it's fine if it goes there.

Thank you!
Willy

Willy Tarreau (2):
  tools/nolibc: tests: fix build on non-c99 compliant compilers
  tools/nolibc: fix build of the test case using glibc

 tools/testing/selftests/nolibc/nolibc-test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
2.17.5


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] tools/nolibc: tests: fix build on non-c99 compliant compilers
  2023-04-02  8:13 [PATCH 0/2] tools/nolibc: assorted build fixes for nolibc-test in rare cases Willy Tarreau
@ 2023-04-02  8:13 ` Willy Tarreau
  2023-04-02  8:13 ` [PATCH 2/2] tools/nolibc: fix build of the test case using glibc Willy Tarreau
  2023-04-02 17:13 ` [PATCH 0/2] tools/nolibc: assorted build fixes for nolibc-test in rare cases Paul E. McKenney
  2 siblings, 0 replies; 4+ messages in thread
From: Willy Tarreau @ 2023-04-02  8:13 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: linux, v, linux-kernel, Willy Tarreau

Commit 9735716830f2 ("tools/nolibc: tests: add test for -fstack-protector")
brought a declaration inside the initialization statement of a for loop,
which breaks the build on compilers that do not default to c99
compatibility, making it more difficult to validate that the lib still
builds on such compilers. The fix is trivial, so let's move the
declaration to the variables block of the function instead. No backport
is needed.

Cc: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
---
 tools/testing/selftests/nolibc/nolibc-test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index 47013b78972e..6f2f109569a3 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -671,8 +671,9 @@ static int smash_stack(void)
 {
 	char buf[100];
 	volatile char *ptr = buf;
+	size_t i;
 
-	for (size_t i = 0; i < 200; i++)
+	for (i = 0; i < 200; i++)
 		ptr[i] = 'P';
 
 	return 1;
-- 
2.17.5


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] tools/nolibc: fix build of the test case using glibc
  2023-04-02  8:13 [PATCH 0/2] tools/nolibc: assorted build fixes for nolibc-test in rare cases Willy Tarreau
  2023-04-02  8:13 ` [PATCH 1/2] tools/nolibc: tests: fix build on non-c99 compliant compilers Willy Tarreau
@ 2023-04-02  8:13 ` Willy Tarreau
  2023-04-02 17:13 ` [PATCH 0/2] tools/nolibc: assorted build fixes for nolibc-test in rare cases Paul E. McKenney
  2 siblings, 0 replies; 4+ messages in thread
From: Willy Tarreau @ 2023-04-02  8:13 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: linux, v, linux-kernel, Willy Tarreau

Some extra tests for various integer types and limits were added by
commit d1209597ff00 ("tools/nolibc: add tests for the integer limits
in stdint.h"), but we forgot to retest with glibc. Stddef and stdint
are now needed for the program to build there.

Cc: Vincent Dagonneau <v@vda.io>
Signed-off-by: Willy Tarreau <w@1wt.eu>
---
 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/selftests/nolibc/nolibc-test.c
index 6f2f109569a3..1bafbd8da6af 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -34,6 +34,8 @@
 #include <sched.h>
 #include <signal.h>
 #include <stdarg.h>
+#include <stddef.h>
+#include <stdint.h>
 #include <unistd.h>
 #endif
 #endif
-- 
2.17.5


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] tools/nolibc: assorted build fixes for nolibc-test in rare cases
  2023-04-02  8:13 [PATCH 0/2] tools/nolibc: assorted build fixes for nolibc-test in rare cases Willy Tarreau
  2023-04-02  8:13 ` [PATCH 1/2] tools/nolibc: tests: fix build on non-c99 compliant compilers Willy Tarreau
  2023-04-02  8:13 ` [PATCH 2/2] tools/nolibc: fix build of the test case using glibc Willy Tarreau
@ 2023-04-02 17:13 ` Paul E. McKenney
  2 siblings, 0 replies; 4+ messages in thread
From: Paul E. McKenney @ 2023-04-02 17:13 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: linux, v, linux-kernel

On Sun, Apr 02, 2023 at 10:13:55AM +0200, Willy Tarreau wrote:
> Hello Paul,
> 
> please find in this series two small build fixes. One of them concerns
> two missing include files for building the test against other libc (at
> least glibc) since we added the tests for integer types and ranges. The
> second one removes a single occurrence of a variable definition inside
> the init statement of a for loop that breaks with older compilers which
> do not default to c99. They're still convenient to test the portability
> of the lib itself and I continue to use them for this purpose.
> 
> I consider that there's no rush on this, since these issues only affect
> developers adding test cases, who should normally rebase on top of your
> dev branch. So it's fine if it goes there.

Queued and pushed for the v6.5 merge window (the one after the upcoming
one), thank you!

							Thanx, Paul

> Thank you!
> Willy
> 
> Willy Tarreau (2):
>   tools/nolibc: tests: fix build on non-c99 compliant compilers
>   tools/nolibc: fix build of the test case using glibc
> 
>  tools/testing/selftests/nolibc/nolibc-test.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> -- 
> 2.17.5
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-02 17:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-02  8:13 [PATCH 0/2] tools/nolibc: assorted build fixes for nolibc-test in rare cases Willy Tarreau
2023-04-02  8:13 ` [PATCH 1/2] tools/nolibc: tests: fix build on non-c99 compliant compilers Willy Tarreau
2023-04-02  8:13 ` [PATCH 2/2] tools/nolibc: fix build of the test case using glibc Willy Tarreau
2023-04-02 17:13 ` [PATCH 0/2] tools/nolibc: assorted build fixes for nolibc-test in rare cases Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®