summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-03-25 10:56:46 -0700
committerKhem Raj <raj.khem@gmail.com>2024-03-25 12:50:33 -0700
commitfbbe7cefdd05c5149ce16975ed5ea56e787e419b (patch)
tree4506393d3138760be4f00cbf9fc954c71bdde84e
parent025e589575690b74c3fbee5faaefd7babfa4b589 (diff)
downloadmeta-openembedded-fbbe7cefdd05c5149ce16975ed5ea56e787e419b.tar.gz
xfstests: Fix build with musl >= 1.2.5
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-filesystems/recipes-utils/xfstests/xfstests/0001-include-libgen.h-for-basename-API-prototype.patch84
-rw-r--r--meta-filesystems/recipes-utils/xfstests/xfstests/0002-Add-missing-STATX_ATTR_-defines-from-musl-sys-stat.h.patch42
-rw-r--r--meta-filesystems/recipes-utils/xfstests/xfstests_2024.03.03.bb2
3 files changed, 128 insertions, 0 deletions
diff --git a/meta-filesystems/recipes-utils/xfstests/xfstests/0001-include-libgen.h-for-basename-API-prototype.patch b/meta-filesystems/recipes-utils/xfstests/xfstests/0001-include-libgen.h-for-basename-API-prototype.patch
new file mode 100644
index 000000000..1570f3131
--- /dev/null
+++ b/meta-filesystems/recipes-utils/xfstests/xfstests/0001-include-libgen.h-for-basename-API-prototype.patch
@@ -0,0 +1,84 @@
1From 37caab7a43da5ede0ff1eb700f0257a213ac4b18 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 25 Mar 2024 10:46:50 -0700
4Subject: [PATCH 1/2] include libgen.h for basename API prototype
5
6basename prototype has been removed from string.h from latest musl [1]
7compilers e.g. clang-18 flags the absense of prototype as error. therefore
8include libgen.h for providing it.
9
10[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
11
12Upstream-Status: Submitted [https://lore.kernel.org/fstests/20240325175323.3450750-1-raj.khem@gmail.com/T/#t]
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 src/splice-test.c | 1 +
16 src/stat_test.c | 1 +
17 src/t_ext4_dax_inline_corruption.c | 1 +
18 src/t_ext4_dax_journal_corruption.c | 1 +
19 src/t_mmap_collision.c | 1 +
20 5 files changed, 5 insertions(+)
21
22diff --git a/src/splice-test.c b/src/splice-test.c
23index eb863673..7b7094f5 100644
24--- a/src/splice-test.c
25+++ b/src/splice-test.c
26@@ -11,6 +11,7 @@
27 #include <unistd.h>
28 #include <fcntl.h>
29 #include <err.h>
30+#include <libgen.h>
31
32 #include <stdlib.h>
33 #include <stdio.h>
34diff --git a/src/stat_test.c b/src/stat_test.c
35index 95cfdc4f..77e1acdd 100644
36--- a/src/stat_test.c
37+++ b/src/stat_test.c
38@@ -4,6 +4,7 @@
39 * Written by David Howells (dhowells@redhat.com)
40 */
41
42+#include <libgen.h>
43 #include <stdarg.h>
44 #include <stdio.h>
45 #include <stdlib.h>
46diff --git a/src/t_ext4_dax_inline_corruption.c b/src/t_ext4_dax_inline_corruption.c
47index e1a39a6c..a40c5df5 100644
48--- a/src/t_ext4_dax_inline_corruption.c
49+++ b/src/t_ext4_dax_inline_corruption.c
50@@ -2,6 +2,7 @@
51 /* Copyright (c) 2018 Intel Corporation. */
52 #include <errno.h>
53 #include <fcntl.h>
54+#include <libgen.h>
55 #include <stdio.h>
56 #include <stdlib.h>
57 #include <string.h>
58diff --git a/src/t_ext4_dax_journal_corruption.c b/src/t_ext4_dax_journal_corruption.c
59index ba7a96e4..53be10c2 100644
60--- a/src/t_ext4_dax_journal_corruption.c
61+++ b/src/t_ext4_dax_journal_corruption.c
62@@ -2,6 +2,7 @@
63 /* Copyright (c) 2018 Intel Corporation. */
64 #include <errno.h>
65 #include <fcntl.h>
66+#include <libgen.h>
67 #include <stdio.h>
68 #include <stdlib.h>
69 #include <string.h>
70diff --git a/src/t_mmap_collision.c b/src/t_mmap_collision.c
71index c872f4e2..d9315fcf 100644
72--- a/src/t_mmap_collision.c
73+++ b/src/t_mmap_collision.c
74@@ -15,6 +15,7 @@
75 */
76 #include <errno.h>
77 #include <fcntl.h>
78+#include <libgen.h>
79 #include <pthread.h>
80 #include <stdbool.h>
81 #include <stdio.h>
82--
832.44.0
84
diff --git a/meta-filesystems/recipes-utils/xfstests/xfstests/0002-Add-missing-STATX_ATTR_-defines-from-musl-sys-stat.h.patch b/meta-filesystems/recipes-utils/xfstests/xfstests/0002-Add-missing-STATX_ATTR_-defines-from-musl-sys-stat.h.patch
new file mode 100644
index 000000000..20095c86a
--- /dev/null
+++ b/meta-filesystems/recipes-utils/xfstests/xfstests/0002-Add-missing-STATX_ATTR_-defines-from-musl-sys-stat.h.patch
@@ -0,0 +1,42 @@
1From 052818e91314b797d96d87672c60f6784160f935 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 25 Mar 2024 10:50:59 -0700
4Subject: [PATCH 2/2] Add missing STATX_ATTR_* defines from musl sys/stat.h
5
6These defines are not provided by sys/stat.h on musl but are
7in glibc's sys/stat.h, therefore to compile the tests on musl
8based systems add the missing defines from linux/stat.h
9if they are not provided
10
11Upstream-Status: Submitted [https://lore.kernel.org/fstests/20240325175323.3450750-2-raj.khem@gmail.com/T/#u]
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 src/statx.h | 12 ++++++++++++
15 1 file changed, 12 insertions(+)
16
17diff --git a/src/statx.h b/src/statx.h
18index 3f239d79..12599f5b 100644
19--- a/src/statx.h
20+++ b/src/statx.h
21@@ -12,6 +12,18 @@
22 #define AT_STATX_DONT_SYNC 0x4000 /* - Don't sync attributes with the server */
23 #endif
24
25+#ifndef STATX_ATTR_COMPRESSED
26+#define STATX_ATTR_COMPRESSED 0x00000004 /* [I] File is compressed by the fs */
27+#define STATX_ATTR_IMMUTABLE 0x00000010 /* [I] File is marked immutable */
28+#define STATX_ATTR_APPEND 0x00000020 /* [I] File is append-only */
29+#define STATX_ATTR_NODUMP 0x00000040 /* [I] File is not to be dumped */
30+#define STATX_ATTR_ENCRYPTED 0x00000800 /* [I] File requires key to decrypt in fs */
31+#define STATX_ATTR_AUTOMOUNT 0x00001000 /* Dir: Automount trigger */
32+#define STATX_ATTR_MOUNT_ROOT 0x00002000 /* Root of a mount */
33+#define STATX_ATTR_VERITY 0x00100000 /* [I] Verity protected file */
34+#define STATX_ATTR_DAX 0x00200000 /* File is currently in DAX state */
35+#endif
36+
37 #ifndef AT_NO_AUTOMOUNT
38 #define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal */
39 #endif
40--
412.44.0
42
diff --git a/meta-filesystems/recipes-utils/xfstests/xfstests_2024.03.03.bb b/meta-filesystems/recipes-utils/xfstests/xfstests_2024.03.03.bb
index 2d5fedb41..c8a80523d 100644
--- a/meta-filesystems/recipes-utils/xfstests/xfstests_2024.03.03.bb
+++ b/meta-filesystems/recipes-utils/xfstests/xfstests_2024.03.03.bb
@@ -10,6 +10,8 @@ SRC_URI = "git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git;branch=master \
10 git://github.com/amir73il/unionmount-testsuite.git;branch=master;protocol=https;name=unionmount;destsuffix=unionmount-testsuite \ 10 git://github.com/amir73il/unionmount-testsuite.git;branch=master;protocol=https;name=unionmount;destsuffix=unionmount-testsuite \
11 file://0001-add-missing-FTW_-macros-when-not-available-in-libc.patch \ 11 file://0001-add-missing-FTW_-macros-when-not-available-in-libc.patch \
12 file://0002-Drop-detached_mounts_propagation-and-remove-sys-moun.patch \ 12 file://0002-Drop-detached_mounts_propagation-and-remove-sys-moun.patch \
13 file://0001-include-libgen.h-for-basename-API-prototype.patch \
14 file://0002-Add-missing-STATX_ATTR_-defines-from-musl-sys-stat.h.patch \
13 " 15 "
14 16
15S = "${WORKDIR}/git" 17S = "${WORKDIR}/git"