string.h tests for the macros NOLIBC_ARCH_HAS_$FUNC to use the architecture-optimized function variants. However if string.h is included before arch.h header than that check does not work, leading to duplicate function definitions.
Fixes: 553845eebd60 ("tools/nolibc: x86-64: Use `rep movsb` for `memcpy()` and `memmove()`") Fixes: 12108aa8c1a1 ("tools/nolibc: x86-64: Use `rep stosb` for `memset()`") Cc: stable@vger.kernel.org Signed-off-by: Thomas Weißschuh linux@weissschuh.net --- If nobody complains I'll apply this after v6.11-rc1 is released. --- tools/include/nolibc/string.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/tools/include/nolibc/string.h b/tools/include/nolibc/string.h index f9ab28421e6d..9ec9c24f38c0 100644 --- a/tools/include/nolibc/string.h +++ b/tools/include/nolibc/string.h @@ -7,6 +7,7 @@ #ifndef _NOLIBC_STRING_H #define _NOLIBC_STRING_H
+#include "arch.h" #include "std.h"
static void *malloc(size_t len);
--- base-commit: 6ca8f2e20bd1ced8a7cd12b3ae4b1ceca85cfc2b change-id: 20240725-arch-has-func-59b6c92ce935
Best regards,
Hi Thomas,
On Thu, Jul 25, 2024 at 06:54:18PM +0200, Thomas Weißschuh wrote:
string.h tests for the macros NOLIBC_ARCH_HAS_$FUNC to use the architecture-optimized function variants. However if string.h is included before arch.h header than that check
^^^^ then
does not work, leading to duplicate function definitions.
Fixes: 553845eebd60 ("tools/nolibc: x86-64: Use `rep movsb` for `memcpy()` and `memmove()`") Fixes: 12108aa8c1a1 ("tools/nolibc: x86-64: Use `rep stosb` for `memset()`") Cc: stable@vger.kernel.org Signed-off-by: Thomas Weißschuh linux@weissschuh.net
Good catch!
Acked-by: Willy Tarreau w@1wt.eu
Thanks, Willy
linux-stable-mirror@lists.linaro.org