<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/include/nolibc/stdlib.h, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-10-29T15:29:16+00:00</updated>
<entry>
<title>tools/nolibc: add option to disable runtime</title>
<updated>2025-10-29T15:29:16+00:00</updated>
<author>
<name>Benjamin Berg</name>
<email>benjamin.berg@intel.com</email>
</author>
<published>2025-09-24T14:20:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3d66c4e14fbf4d59ca4665391d133655fa668042'/>
<id>urn:sha1:3d66c4e14fbf4d59ca4665391d133655fa668042</id>
<content type='text'>
In principle, it is possible to use nolibc for only some object files in
a program. In that case, the startup code in _start and _start_c is not
going to be used. Add the NOLIBC_NO_RUNTIME compile time option to
disable it entirely and also remove anything that depends on it.

Doing this avoids warnings from modpost for UML as the _start_c code
references the main function from the .init.text section while it is not
inside .init itself.

Signed-off-by: Benjamin Berg &lt;benjamin.berg@intel.com&gt;
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: add abs() and friends</title>
<updated>2025-05-21T13:32:05+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>thomas.weissschuh@linutronix.de</email>
</author>
<published>2025-04-28T12:40:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bf5e8a78beded3503bbcfe86b3094a42ce492556'/>
<id>urn:sha1:bf5e8a78beded3503bbcfe86b3094a42ce492556</id>
<content type='text'>
This is used in various selftests and will be handy when integrating
those with nolibc.

Signed-off-by: Thomas Weißschuh &lt;thomas.weissschuh@linutronix.de&gt;
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20250428-nolibc-misc-v2-6-3c043eeab06c@linutronix.de
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: include nolibc.h early from all header files</title>
<updated>2025-05-21T13:31:50+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>thomas.weissschuh@linutronix.de</email>
</author>
<published>2025-04-24T11:48:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3785289f97e2118b157332ffaae9fd2ec71237c8'/>
<id>urn:sha1:3785289f97e2118b157332ffaae9fd2ec71237c8</id>
<content type='text'>
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 &lt;thomas.weissschuh@linutronix.de&gt;
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20250424-nolibc-header-check-v1-2-011576b6ed6f@linutronix.de
</content>
</entry>
<entry>
<title>tools/nolibc: move getauxval() to sys/auxv.h</title>
<updated>2025-04-19T12:22:22+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>thomas.weissschuh@linutronix.de</email>
</author>
<published>2025-04-16T12:06:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9e67941dde6e7f2b0e46ca8e2c87d3fb12e5ead5'/>
<id>urn:sha1:9e67941dde6e7f2b0e46ca8e2c87d3fb12e5ead5</id>
<content type='text'>
This is the location regular userspace expects the definition.

Signed-off-by: Thomas Weißschuh &lt;thomas.weissschuh@linutronix.de&gt;
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20250416-nolibc-split-sys-v1-4-a069a3f1d145@linutronix.de
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: fix integer overflow in i{64,}toa_r() and</title>
<updated>2025-04-19T12:18:05+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2025-04-19T10:46:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4d231a7df1a85c7572b67a4666cb73adb977fbf6'/>
<id>urn:sha1:4d231a7df1a85c7572b67a4666cb73adb977fbf6</id>
<content type='text'>
In twos complement the most negative number can not be negated.

Fixes: b1c21e7d99cd ("tools/nolibc/stdlib: add i64toa() and u64toa()")
Fixes: 66c397c4d2e1 ("tools/nolibc/stdlib: replace the ltoa() function with more efficient ones")
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20250419-nolibc-ubsan-v2-5-060b8a016917@weissschuh.net
</content>
</entry>
<entry>
<title>tools/nolibc: add prototypes for non-static functions</title>
<updated>2025-02-03T19:57:37+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2025-01-23T20:10:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0de64754a55470adb0a870f3105c8922334bb6fe'/>
<id>urn:sha1:0de64754a55470adb0a870f3105c8922334bb6fe</id>
<content type='text'>
With -Wmissing-prototypes the compiler will warn about non-static
functions which don't have a prototype defined.
This warning doesn't make much sense for nolibc itself but for user code
it is still useful.
To pacify the compiler add prototypes next to the function definitions,
similar to how it is handled elsewhere in the kernel.

Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20250123-nolibc-prototype-v1-1-e1afc5c1999a@weissschuh.net
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: implement strtol() and friends</title>
<updated>2024-06-29T07:44:55+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2024-04-25T16:09:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0cf24d36bb2723da861edb5cca30656fe2637cf7'/>
<id>urn:sha1:0cf24d36bb2723da861edb5cca30656fe2637cf7</id>
<content type='text'>
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 &lt;linux@weissschuh.net&gt;
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20240425-nolibc-strtol-v1-2-bfeef7846902@weissschuh.net
</content>
</entry>
<entry>
<title>tools/nolibc/stdlib: fix memory error in realloc()</title>
<updated>2024-04-10T21:19:00+00:00</updated>
<author>
<name>Brennan Xavier McManus</name>
<email>bxmcmanus@gmail.com</email>
</author>
<published>2024-01-09T23:44:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=791f4641142e2aced85de082e5783b4fb0b977c2'/>
<id>urn:sha1:791f4641142e2aced85de082e5783b4fb0b977c2</id>
<content type='text'>
Pass user_p_len to memcpy() instead of heap-&gt;len to prevent realloc()
from copying an extra sizeof(heap) bytes from beyond the allocated
region.

Signed-off-by: Brennan Xavier McManus &lt;bxmcmanus@gmail.com&gt;
Cc: stable@vger.kernel.org
Reviewed-by: Ammar Faizi &lt;ammarfaizi2@gnuweeb.org&gt;
Fixes: 0e0ff638400be8f497a35b51a4751fd823f6bd6a ("tools/nolibc/stdlib: Implement `malloc()`, `calloc()`, `realloc()` and `free()`")
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: completely remove optional environ support</title>
<updated>2023-08-23T02:40:22+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2023-07-10T18:01:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=67d108e2a2bd258b49902ea9d85c25a53a7c5e5b'/>
<id>urn:sha1:67d108e2a2bd258b49902ea9d85c25a53a7c5e5b</id>
<content type='text'>
In commit 52e423f5b93e ("tools/nolibc: export environ as a weak symbol on i386")
and friends the asm startup logic was extended to directly populate the
"environ" array.

This makes it impossible for "environ" to be dropped by the linker.
Therefore also drop the other logic to handle non-present "environ".

Also add a testcase to validate the initialization of environ.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: use __inline__ syntax</title>
<updated>2023-06-09T18:46:07+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2023-04-06T21:54:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0738c2d7bf93cb2c11cd4b24b53a77fe9faaad5d'/>
<id>urn:sha1:0738c2d7bf93cb2c11cd4b24b53a77fe9faaad5d</id>
<content type='text'>
When building in strict C89 mode the "inline" keyword is unknown.
While "__inline__" is non-standard it is used by the kernel headers
themselves.
So the used compilers would have to support it or the users shim it with
a #define.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
</feed>
