* [Buildroot] [PATCH 1/1] package/zfs: add patch to fix build with uclibc >= 1.0.57
@ 2026-03-16 20:14 Julien Olivain via buildroot
2026-03-16 20:59 ` Julien Olivain via buildroot
2026-03-27 10:02 ` Thomas Perale via buildroot
0 siblings, 2 replies; 3+ messages in thread
From: Julien Olivain via buildroot @ 2026-03-16 20:14 UTC (permalink / raw)
To: buildroot; +Cc: José Luis Salvador Rufo, Julien Olivain
uclibc 1.0.57 added a statx() syscall wrapper in upstream commit [1].
zfs fail to build with uclibc 1.0.57 (not yet in Buildroot), because:
1. uclibc <fcntl.h> internally includes <sys/stat.h>, and
2. a zfs test redefines a statx() wrapper with a slightly different
prototype.
In that case, zfs fails to compile with error:
tests/zfs-tests/cmd/statx.c:58:1: error: conflicting types for 'statx'; have 'int(int, const char *, int, unsigned int, void *)'
Issue has been reported upstream at [2].
This commit adds a package patch to fix that issue.
[1] https://github.com/wbx-github/uclibc-ng/commit/d3a819aff25af436e22abd5ba01ff2cfc0631b32
[2] https://github.com/openzfs/zfs/pull/18316
Signed-off-by: Julien Olivain <ju.o@free.fr>
---
This patch is meant to be applied before updating uclibc:
https://patchwork.ozlabs.org/project/buildroot/patch/aaQ0OC8I4PAx0xZz@waldemar-brodkorb.de/
---
...ts-cmd-statx.c-avoid-statx-conflicts.patch | 49 +++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100644 package/zfs/0001-tests-zfs-tests-cmd-statx.c-avoid-statx-conflicts.patch
diff --git a/package/zfs/0001-tests-zfs-tests-cmd-statx.c-avoid-statx-conflicts.patch b/package/zfs/0001-tests-zfs-tests-cmd-statx.c-avoid-statx-conflicts.patch
new file mode 100644
index 0000000000..98f905aa48
--- /dev/null
+++ b/package/zfs/0001-tests-zfs-tests-cmd-statx.c-avoid-statx-conflicts.patch
@@ -0,0 +1,49 @@
+From d363aafe0a773cd55890a385694cf05cb6225c5a Mon Sep 17 00:00:00 2001
+From: Julien Olivain <ju.o@free.fr>
+Date: Sun, 15 Mar 2026 13:18:07 +0100
+Subject: [PATCH] tests/zfs-tests/cmd/statx.c: avoid statx() conflicts
+
+With some libc, such as uclibc >= 1.0.57, the libc defines the statx()
+function, while also internally including <sys/stat.h> (from <fcntl.h>
+from example), which results to a compilation error due to conflicting
+types.
+
+This commit fixes the issue by only defining the statx() prototype only
+if the libc was detected not to have a working statx() wrapper, and
+explicitly include the <sys/stat.h> otherwise.
+
+Upstream: Discussed in: https://github.com/openzfs/zfs/pull/18316#issuecomment-4062904581
+Signed-off-by: Julien Olivain <ju.o@free.fr>
+---
+ tests/zfs-tests/cmd/statx.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/tests/zfs-tests/cmd/statx.c b/tests/zfs-tests/cmd/statx.c
+index 1acc7e58c..c292fdbdf 100644
+--- a/tests/zfs-tests/cmd/statx.c
++++ b/tests/zfs-tests/cmd/statx.c
+@@ -34,6 +34,9 @@
+ * statx() may be available in the kernel, but not in the libc, so we build
+ * our own wrapper if we can't link one.
+ */
++#ifdef HAVE_STATX
++#include <sys/stat.h>
++#endif
+
+ #ifndef __NR_statx
+ #if defined(__x86_64__)
+@@ -54,9 +57,11 @@
+ #endif /* __NR_statx */
+
+
++#ifndef HAVE_STATX
+ int
+ statx(int, const char *, int, unsigned int, void *)
+ __attribute__((weak));
++#endif
+
+ static inline int
+ _statx(int fd, const char *path, int flags, unsigned int mask, void *stx)
+--
+2.53.0
+
--
2.53.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/zfs: add patch to fix build with uclibc >= 1.0.57
2026-03-16 20:14 [Buildroot] [PATCH 1/1] package/zfs: add patch to fix build with uclibc >= 1.0.57 Julien Olivain via buildroot
@ 2026-03-16 20:59 ` Julien Olivain via buildroot
2026-03-27 10:02 ` Thomas Perale via buildroot
1 sibling, 0 replies; 3+ messages in thread
From: Julien Olivain via buildroot @ 2026-03-16 20:59 UTC (permalink / raw)
To: Julien Olivain; +Cc: buildroot, José Luis Salvador Rufo
On 16/03/2026 21:14, Julien Olivain via buildroot wrote:
> uclibc 1.0.57 added a statx() syscall wrapper in upstream commit [1].
>
> zfs fail to build with uclibc 1.0.57 (not yet in Buildroot), because:
> 1. uclibc <fcntl.h> internally includes <sys/stat.h>, and
> 2. a zfs test redefines a statx() wrapper with a slightly different
> prototype.
>
> In that case, zfs fails to compile with error:
>
> tests/zfs-tests/cmd/statx.c:58:1: error: conflicting types for
> 'statx'; have 'int(int, const char *, int, unsigned int, void *)'
>
> Issue has been reported upstream at [2].
>
> This commit adds a package patch to fix that issue.
>
> [1]
> https://github.com/wbx-github/uclibc-ng/commit/d3a819aff25af436e22abd5ba01ff2cfc0631b32
> [2] https://github.com/openzfs/zfs/pull/18316
>
> Signed-off-by: Julien Olivain <ju.o@free.fr>
Applied to master.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/zfs: add patch to fix build with uclibc >= 1.0.57
2026-03-16 20:14 [Buildroot] [PATCH 1/1] package/zfs: add patch to fix build with uclibc >= 1.0.57 Julien Olivain via buildroot
2026-03-16 20:59 ` Julien Olivain via buildroot
@ 2026-03-27 10:02 ` Thomas Perale via buildroot
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Perale via buildroot @ 2026-03-27 10:02 UTC (permalink / raw)
To: Julien Olivain; +Cc: Thomas Perale, buildroot
In reply of:
> uclibc 1.0.57 added a statx() syscall wrapper in upstream commit [1].
>
> zfs fail to build with uclibc 1.0.57 (not yet in Buildroot), because:
> 1. uclibc <fcntl.h> internally includes <sys/stat.h>, and
> 2. a zfs test redefines a statx() wrapper with a slightly different
> prototype.
>
> In that case, zfs fails to compile with error:
>
> tests/zfs-tests/cmd/statx.c:58:1: error: conflicting types for 'statx'; have 'int(int, const char *, int, unsigned int, void *)'
>
> Issue has been reported upstream at [2].
>
> This commit adds a package patch to fix that issue.
>
> [1] https://github.com/wbx-github/uclibc-ng/commit/d3a819aff25af436e22abd5ba01ff2cfc0631b32
> [2] https://github.com/openzfs/zfs/pull/18316
>
> Signed-off-by: Julien Olivain <ju.o@free.fr>
Applied to 2026.02.x & 2025.02.x. Thanks
> ---
> This patch is meant to be applied before updating uclibc:
> https://patchwork.ozlabs.org/project/buildroot/patch/aaQ0OC8I4PAx0xZz@waldemar-brodkorb.de/
> ---
> ...ts-cmd-statx.c-avoid-statx-conflicts.patch | 49 +++++++++++++++++++
> 1 file changed, 49 insertions(+)
> create mode 100644 package/zfs/0001-tests-zfs-tests-cmd-statx.c-avoid-statx-conflicts.patch
>
> diff --git a/package/zfs/0001-tests-zfs-tests-cmd-statx.c-avoid-statx-conflicts.patch b/package/zfs/0001-tests-zfs-tests-cmd-statx.c-avoid-statx-conflicts.patch
> new file mode 100644
> index 0000000000..98f905aa48
> --- /dev/null
> +++ b/package/zfs/0001-tests-zfs-tests-cmd-statx.c-avoid-statx-conflicts.patch
> @@ -0,0 +1,49 @@
> +From d363aafe0a773cd55890a385694cf05cb6225c5a Mon Sep 17 00:00:00 2001
> +From: Julien Olivain <ju.o@free.fr>
> +Date: Sun, 15 Mar 2026 13:18:07 +0100
> +Subject: [PATCH] tests/zfs-tests/cmd/statx.c: avoid statx() conflicts
> +
> +With some libc, such as uclibc >= 1.0.57, the libc defines the statx()
> +function, while also internally including <sys/stat.h> (from <fcntl.h>
> +from example), which results to a compilation error due to conflicting
> +types.
> +
> +This commit fixes the issue by only defining the statx() prototype only
> +if the libc was detected not to have a working statx() wrapper, and
> +explicitly include the <sys/stat.h> otherwise.
> +
> +Upstream: Discussed in: https://github.com/openzfs/zfs/pull/18316#issuecomment-4062904581
> +Signed-off-by: Julien Olivain <ju.o@free.fr>
> +---
> + tests/zfs-tests/cmd/statx.c | 5 +++++
> + 1 file changed, 5 insertions(+)
> +
> +diff --git a/tests/zfs-tests/cmd/statx.c b/tests/zfs-tests/cmd/statx.c
> +index 1acc7e58c..c292fdbdf 100644
> +--- a/tests/zfs-tests/cmd/statx.c
> ++++ b/tests/zfs-tests/cmd/statx.c
> +@@ -34,6 +34,9 @@
> + * statx() may be available in the kernel, but not in the libc, so we build
> + * our own wrapper if we can't link one.
> + */
> ++#ifdef HAVE_STATX
> ++#include <sys/stat.h>
> ++#endif
> +
> + #ifndef __NR_statx
> + #if defined(__x86_64__)
> +@@ -54,9 +57,11 @@
> + #endif /* __NR_statx */
> +
> +
> ++#ifndef HAVE_STATX
> + int
> + statx(int, const char *, int, unsigned int, void *)
> + __attribute__((weak));
> ++#endif
> +
> + static inline int
> + _statx(int fd, const char *path, int flags, unsigned int mask, void *stx)
> +--
> +2.53.0
> +
> --
> 2.53.0
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-27 10:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16 20:14 [Buildroot] [PATCH 1/1] package/zfs: add patch to fix build with uclibc >= 1.0.57 Julien Olivain via buildroot
2026-03-16 20:59 ` Julien Olivain via buildroot
2026-03-27 10:02 ` Thomas Perale via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox