Skip to contentSkip to conversation

xfstests: Fix build with musl

PATCH New Khem Raj 1 participant 1 message Mar 25, 2023

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 xfstests: Fix build with musl

Musl does not implement FTW_ACTIONRETVAL which is a GNU extention therefore add that to configure check before enabling nftw

---
 ...for-FTW_ACTIONRETVAL-along-with-nftw.patch | 34 +++++++++++++++++++
 .../xfstests/xfstests_2023.03.05.bb           |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta-filesystems/recipes-utils/xfstests/xfstests/0001-m4-Check-for-FTW_ACTIONRETVAL-along-with-nftw.patch
meta-filesystems/recipes-utils/xfstests/xfstests/0001-m4-Check-for-FTW_ACTIONRETVAL-along-with-nftw.patch new file +34 -0
new file mode 100644
index 0000000000..fd34989fdf
@@ -0,0 +1,34 @@
+From 2a4fed8331f996421e65db446559991a854e2ad3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 24 Mar 2023 18:23:01 -0700
+Subject: [PATCH] m4: Check for FTW_ACTIONRETVAL along with nftw
+
+FTW_ACTIONRETVAL is glibc specific extention which is used to implement
+xfsfind but it may not be available on other C library implementations on Linux
+e.g. musl. Therefore ensure that these defines are available before declaring
+nftw() to be usable
+
+Upstream-Status: Submitted [https://lore.kernel.org/fstests/[email protected]/T/#u]
+Signed-off-by: Khem Raj <[email protected]>
+Cc: Darrick J. Wong <[email protected]>
+Cc: Zorro Lang <[email protected]>
+---
+ m4/package_libcdev.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4
+index b41c087b..7f731044 100644
+--- a/m4/package_libcdev.m4
++++ b/m4/package_libcdev.m4
+@@ -132,7 +132,7 @@ AC_DEFUN([AC_HAVE_NFTW],
+ #include <stddef.h>
+ #include <ftw.h>
+     ]], [[
+-         nftw("/", (int (*)(const char *, const struct stat *, int, struct FTW *))1, 0, 0);
++         nftw("/", (int (*)(const char *, const struct stat *, int, struct FTW *))1, 0, FTW_ACTIONRETVAL);
+     ]])],[have_nftw=yes
+        AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
+     AC_SUBST(have_nftw)
+-- 
+2.40.0
+
meta-filesystems/recipes-utils/xfstests/xfstests_2023.03.05.bb +1 -0
index 9baa31f712..fdfe045749 100644
@@ -8,6 +8,7 @@ SRC_URI = "git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git;branch=master;na
            git://github.com/amir73il/unionmount-testsuite.git;branch=master;protocol=https;name=unionmount;destsuffix=unionmount-testsuite \
            file://0001-Add-a-return-type-to-aio_rw.patch \
            file://0002-Drop-detached_mounts_propagation-and-remove-sys-moun.patch \
+           file://0001-m4-Check-for-FTW_ACTIONRETVAL-along-with-nftw.patch \
            "
 
 SRCREV_xfstests = "f7765774a1b5cb98c2f21a892e82b3421f40e791"
Signature · 1 line
2.40.0