[PATCH v2 09/16] tools/nolibc: add limits.h shim header

Thomas Weißschuh posted 16 patches 9 months, 3 weeks ago
[PATCH v2 09/16] tools/nolibc: add limits.h shim header
Posted by Thomas Weißschuh 9 months, 3 weeks ago
limits.h is a widely used standard header.
Missing it from nolibc requires adoption effort to port applications.

Add a shim header which includes the global nolibc.h header.
It makes all nolibc symbols available.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 tools/include/nolibc/Makefile | 1 +
 tools/include/nolibc/limits.h | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile
index a1f55fb24bb38c1f49c653af5825e8bcc569a56d..c1299a053145786da89001a5f95f5527ffbe2fa4 100644
--- a/tools/include/nolibc/Makefile
+++ b/tools/include/nolibc/Makefile
@@ -30,6 +30,7 @@ all_files := \
 		crt.h \
 		ctype.h \
 		errno.h \
+		limits.h \
 		nolibc.h \
 		signal.h \
 		stackprotector.h \
diff --git a/tools/include/nolibc/limits.h b/tools/include/nolibc/limits.h
new file mode 100644
index 0000000000000000000000000000000000000000..306d4141f4d245ca3f801f451745540b0f7294cd
--- /dev/null
+++ b/tools/include/nolibc/limits.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
+/*
+ * Shim limits.h header for NOLIBC.
+ * Copyright (C) 2025 Thomas Weißschuh <thomas.weissschuh@linutronix.de>
+ */
+
+#include "nolibc.h"

-- 
2.48.1

Re: [PATCH v2 09/16] tools/nolibc: add limits.h shim header
Posted by Willy Tarreau 9 months, 3 weeks ago
On Wed, Feb 26, 2025 at 12:44:48PM +0100, Thomas Weißschuh wrote:
> limits.h is a widely used standard header.
> Missing it from nolibc requires adoption effort to port applications.
> 
> Add a shim header which includes the global nolibc.h header.
> It makes all nolibc symbols available.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Works fine here. Pick any combination you'd like of those below ;-)

  Acked-by: Willy Tarreau <w@1wt.eu>
  Tested-by: Willy Tarreau <w@1wt.eu>

Thanks!
Willy
Re: [PATCH v2 09/16] tools/nolibc: add limits.h shim header
Posted by Vincenzo Frascino 9 months, 3 weeks ago

On 26/02/2025 11:44, Thomas Weißschuh wrote:
> limits.h is a widely used standard header.
> Missing it from nolibc requires adoption effort to port applications.
> 
> Add a shim header which includes the global nolibc.h header.
> It makes all nolibc symbols available.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>

> ---
>  tools/include/nolibc/Makefile | 1 +
>  tools/include/nolibc/limits.h | 7 +++++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile
> index a1f55fb24bb38c1f49c653af5825e8bcc569a56d..c1299a053145786da89001a5f95f5527ffbe2fa4 100644
> --- a/tools/include/nolibc/Makefile
> +++ b/tools/include/nolibc/Makefile
> @@ -30,6 +30,7 @@ all_files := \
>  		crt.h \
>  		ctype.h \
>  		errno.h \
> +		limits.h \
>  		nolibc.h \
>  		signal.h \
>  		stackprotector.h \
> diff --git a/tools/include/nolibc/limits.h b/tools/include/nolibc/limits.h
> new file mode 100644
> index 0000000000000000000000000000000000000000..306d4141f4d245ca3f801f451745540b0f7294cd
> --- /dev/null
> +++ b/tools/include/nolibc/limits.h
> @@ -0,0 +1,7 @@
> +/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
> +/*
> + * Shim limits.h header for NOLIBC.
> + * Copyright (C) 2025 Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> + */
> +
> +#include "nolibc.h"
> 

-- 
Regards,
Vincenzo

[tip: timers/vdso] tools/nolibc: add limits.h shim header
Posted by tip-bot2 for Thomas Weißschuh 9 months, 2 weeks ago
The following commit has been merged into the timers/vdso branch of tip:

Commit-ID:     5caaa0aa7c61513a2f606fd6d00fc29ae475ce9e
Gitweb:        https://git.kernel.org/tip/5caaa0aa7c61513a2f606fd6d00fc29ae475ce9e
Author:        Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate:    Wed, 26 Feb 2025 12:44:48 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 03 Mar 2025 20:00:12 +01:00

tools/nolibc: add limits.h shim header

limits.h is a widely used standard header.  Missing it from nolibc requires
adoption effort to port applications.

Add a shim header which includes the global nolibc.h header.
It makes all nolibc symbols available.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Willy Tarreau <w@1wt.eu>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Acked-by: Willy Tarreau <w@1wt.eu>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/all/20250226-parse_vdso-nolibc-v2-9-28e14e031ed8@linutronix.de
---
 tools/include/nolibc/Makefile | 1 +
 tools/include/nolibc/limits.h | 7 +++++++
 2 files changed, 8 insertions(+)
 create mode 100644 tools/include/nolibc/limits.h

diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile
index a1f55fb..c1299a0 100644
--- a/tools/include/nolibc/Makefile
+++ b/tools/include/nolibc/Makefile
@@ -30,6 +30,7 @@ all_files := \
 		crt.h \
 		ctype.h \
 		errno.h \
+		limits.h \
 		nolibc.h \
 		signal.h \
 		stackprotector.h \
diff --git a/tools/include/nolibc/limits.h b/tools/include/nolibc/limits.h
new file mode 100644
index 0000000..306d414
--- /dev/null
+++ b/tools/include/nolibc/limits.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
+/*
+ * Shim limits.h header for NOLIBC.
+ * Copyright (C) 2025 Thomas Weißschuh <thomas.weissschuh@linutronix.de>
+ */
+
+#include "nolibc.h"