[Toybox] [PATCH] Fix portability towards musl by including string.h.
Rob Landley
rob at landley.net
Thu Aug 13 18:16:21 UTC 2026
On 8/12/26 16:55, kroovy via Toybox wrote:
> Signed-off-by: kroovy <me at kroovy.de>
> ---
> lib/portability.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/portability.h b/lib/portability.h
> index fa497c19..b4076e5a 100644
> --- a/lib/portability.h
> +++ b/lib/portability.h
> @@ -26,6 +26,7 @@
> // For musl
> #define _ALL_SOURCE
> #include <regex.h>
> +#include <string.h>
> #ifndef REG_STARTEND
> #define REG_STARTEND 0
> #endif
A) string.h is #included in toys.h under "General posix-2008 headers".
B) I build against musl regularly, using the toolchains at
https://landley.net/bin/toolchains/latest/ and the resulting binaries go
in https://landley.net/bin/toybox/latest/ and
https://landley.net/bin/mkroot/latest/
What symptom did you see from the missing #include? (I can see there
being a sequencing issue, since the general headers go after
portability.h, but I didn't encounter this building last release's
binaries in June, and if it's shown up since the musl-1.2.6 release in
https://landley.net/bin/toolchains/latest/README it's probably a
regression Rich should hear about...
Rob
More information about the Toybox
mailing list