tools/nolibc: include arch.h from string.h
authorThomas Weißschuh <linux@weissschuh.net>
Thu, 25 Jul 2024 16:54:18 +0000 (18:54 +0200)
committerThomas Weißschuh <linux@weissschuh.net>
Mon, 29 Jul 2024 05:52:56 +0000 (07:52 +0200)
commit6ea2987c9a7b6c5f37d08a3eaa664c9ff7467670
tree8e602c3ba559bcebc73b402eeea74192d626d0fa
parent8400291e289ee6b2bf9779ff1c83a291501f017b
tools/nolibc: include arch.h from string.h

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 then 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
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20240725-arch-has-func-v1-1-5521ed354acd@weissschuh.net
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
tools/include/nolibc/string.h