* [PATCH 1/1] s390: add missing limits.h header inclusion
@ 2024-07-19 17:47 Julien Olivain
2024-07-23 9:58 ` Simon Horman
0 siblings, 1 reply; 2+ messages in thread
From: Julien Olivain @ 2024-07-19 17:47 UTC (permalink / raw)
To: kexec; +Cc: Julien Olivain
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@free.fr>
---
kexec/arch/s390/kexec-s390.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kexec/arch/s390/kexec-s390.c b/kexec/arch/s390/kexec-s390.c
index f4dd7dc..ad3eb93 100644
--- a/kexec/arch/s390/kexec-s390.c
+++ b/kexec/arch/s390/kexec-s390.c
@@ -13,6 +13,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
+#include <limits.h>
#include <stdint.h>
#include <string.h>
#include <getopt.h>
--
2.45.2
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] s390: add missing limits.h header inclusion
2024-07-19 17:47 [PATCH 1/1] s390: add missing limits.h header inclusion Julien Olivain
@ 2024-07-23 9:58 ` Simon Horman
0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2024-07-23 9:58 UTC (permalink / raw)
To: Julien Olivain; +Cc: kexec
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@free.fr>
Thanks Julien, applied.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-23 9:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-19 17:47 [PATCH 1/1] s390: add missing limits.h header inclusion Julien Olivain
2024-07-23 9:58 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox