[PATCH 1/1] s390: add missing limits.h header inclusion

Simon Horman horms at kernel.org
Tue Jul 23 02:58:50 PDT 2024


On Fri, Jul 19, 2024 at 07:47:44PM +0200, Julien Olivain wrote:
> Commit b84fcdd48c [1] introduced a usage of PATH_MAX in file
> "kexec-s390.c". This constant is defined in the <limits.h> header.
> See [2].
> 
> With some libc, such as musl, kexec-tools fails to build with output:
> 
>     kexec/arch/s390/kexec-s390.c: In function 'remove_offline_memory':
>     kexec/arch/s390/kexec-s390.c:120:19: error: 'PATH_MAX' undeclared (first use in this function)
>       120 |         char path[PATH_MAX];
>           |                   ^~~~~~~~
> 
> The issue can be reproduced, for example, with Buildroot Linux, using
> a s390 gcc toolchain with the musl libc and the following commands:
> 
>     git clone -b 2024.05.1 --depth 1 https://gitlab.com/buildroot.org/buildroot.git
>     cd buildroot
>     cat > .config <<EOF
>     BR2_s390x=y
>     BR2_TOOLCHAIN_BUILDROOT_MUSL=y
>     BR2_PACKAGE_KEXEC=y
>     EOF
>     make olddefconfig
>     make
> 
> Note: in this test, kexec-tools v2.0.28 is used.
> 
> This commit fixes the issue by adding the missing header inclusion.
> 
> [1] https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=b84fcdd48cbe70e54e66f2cf1b251e0db58f04f4
> [2] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
> 
> Signed-off-by: Julien Olivain <ju.o at free.fr>

Thanks Julien, applied.



More information about the kexec mailing list