Re: [oe] [meta-filesystems][PATCH 2/2] xfstests: Fix build with musl >= 1.2.5
On Mon, Mar 25, 2024 at 11:23 AM Martin Jansa wrote: > > On Mon, Mar 25, 2024 at 6:57 PM Khem Raj wrote: > > > > Signed-off-by: Khem Raj > > --- > > ...-libgen.h-for-basename-API-prototype.patch | 84 +++ > > ...X_ATTR_-defines-from-musl-sys-stat.h.patch | 42 ++ > > .../xfstests/xfstests_2024.03.03.bb | 2 + > > 3 files changed, 128 insertions(+) > > create mode 100644 > > meta-filesystems/recipes-utils/xfstests/xfstests/0001-include-libgen.h-for-basename-API-prototype.patch > > create mode 100644 > > meta-filesystems/recipes-utils/xfstests/xfstests/0002-Add-missing-STATX_ATTR_-defines-from-musl-sys-stat.h.patch > > > > 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 00..1f7ae32f04 > > --- /dev/null > > +++ > > b/meta-filesystems/recipes-utils/xfstests/xfstests/0001-include-libgen.h-for-basename-API-prototype.patch > > @@ -0,0 +1,84 @@ > > +From 37caab7a43da5ede0ff1eb700f0257a213ac4b18 Mon Sep 17 00:00:00 2001 > > +From: Khem Raj > > +Date: Mon, 25 Mar 2024 10:46:50 -0700 > > +Subject: [PATCH 1/2] include libgen.h for basename API prototype > > + > > +basename prototype has been removed from string.h from latest musl [1] > > +compilers e.g. clang-18 flags the absense of prototype as error. therefore > > +include libgen.h for providing it. > > + > > +[1] > > https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 > > + > > +Upstream-Status: > > [https://lore.kernel.org/fstests/20240325175323.3450750-1-raj.k...@gmail.com/T/#t] > > You forgot "Submitted" here. indeed, Fixed in master-next > > > +Signed-off-by: Khem Raj > > +--- > > + src/splice-test.c | 1 + > > + src/stat_test.c | 1 + > > + src/t_ext4_dax_inline_corruption.c | 1 + > > + src/t_ext4_dax_journal_corruption.c | 1 + > > + src/t_mmap_collision.c | 1 + > > + 5 files changed, 5 insertions(+) > > + > > +diff --git a/src/splice-test.c b/src/splice-test.c > > +index eb863673..7b7094f5 100644 > > +--- a/src/splice-test.c > > b/src/splice-test.c > > +@@ -11,6 +11,7 @@ > > + #include > > + #include > > + #include > > ++#include > > + > > + #include > > + #include > > +diff --git a/src/stat_test.c b/src/stat_test.c > > +index 95cfdc4f..77e1acdd 100644 > > +--- a/src/stat_test.c > > b/src/stat_test.c > > +@@ -4,6 +4,7 @@ > > + * Written by David Howells (dhowe...@redhat.com) > > + */ > > + > > ++#include > > + #include > > + #include > > + #include > > +diff --git a/src/t_ext4_dax_inline_corruption.c > > b/src/t_ext4_dax_inline_corruption.c > > +index e1a39a6c..a40c5df5 100644 > > +--- a/src/t_ext4_dax_inline_corruption.c > > b/src/t_ext4_dax_inline_corruption.c > > +@@ -2,6 +2,7 @@ > > + /* Copyright (c) 2018 Intel Corporation. */ > > + #include > > + #include > > ++#include > > + #include > > + #include > > + #include > > +diff --git a/src/t_ext4_dax_journal_corruption.c > > b/src/t_ext4_dax_journal_corruption.c > > +index ba7a96e4..53be10c2 100644 > > +--- a/src/t_ext4_dax_journal_corruption.c > > b/src/t_ext4_dax_journal_corruption.c > > +@@ -2,6 +2,7 @@ > > + /* Copyright (c) 2018 Intel Corporation. */ > > + #include > > + #include > > ++#include > > + #include > > + #include > > + #include > > +diff --git a/src/t_mmap_collision.c b/src/t_mmap_collision.c > > +index c872f4e2..d9315fcf 100644 > > +--- a/src/t_mmap_collision.c > > b/src/t_mmap_collision.c > > +@@ -15,6 +15,7 @@ > > + */ > > + #include > > + #include > > ++#include > > + #include > > + #include > > + #include > > +-- > > +2.44.0 > > + > > 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 00..20095c86ab > > --- /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 @@ > > +From 052818e91314b797d96d87672c60f6784160f935 Mon Sep 17 00:00:00 2001 > > +From: Khem Raj > > +Date: Mon, 25 Mar 2024 10:50:59 -0700 > > +Subject: [PATCH 2/2] Add missing STATX_ATTR_* defines from musl sys/stat.h > > + > > +These defines are not provided by sys/stat.h on musl but are > > +in glibc's sys/stat.h, therefore to compile the tests on musl > > +based systems add the missing defines from linux/stat.h > > +if they are not provided > > + > > +Upstream-Status: Submitted > > [https://lore.kernel.org/fstests/20240325175323.3450750-2-raj.k...@gmail.com/T/#u] > > +Signed-off-by: Khem Raj > > +--- > > + src/statx.h | 12 > > + 1 file changed, 1
Re: [oe] [meta-filesystems][PATCH 2/2] xfstests: Fix build with musl >= 1.2.5
On Mon, Mar 25, 2024 at 6:57 PM Khem Raj wrote: > > Signed-off-by: Khem Raj > --- > ...-libgen.h-for-basename-API-prototype.patch | 84 +++ > ...X_ATTR_-defines-from-musl-sys-stat.h.patch | 42 ++ > .../xfstests/xfstests_2024.03.03.bb | 2 + > 3 files changed, 128 insertions(+) > create mode 100644 > meta-filesystems/recipes-utils/xfstests/xfstests/0001-include-libgen.h-for-basename-API-prototype.patch > create mode 100644 > meta-filesystems/recipes-utils/xfstests/xfstests/0002-Add-missing-STATX_ATTR_-defines-from-musl-sys-stat.h.patch > > 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 00..1f7ae32f04 > --- /dev/null > +++ > b/meta-filesystems/recipes-utils/xfstests/xfstests/0001-include-libgen.h-for-basename-API-prototype.patch > @@ -0,0 +1,84 @@ > +From 37caab7a43da5ede0ff1eb700f0257a213ac4b18 Mon Sep 17 00:00:00 2001 > +From: Khem Raj > +Date: Mon, 25 Mar 2024 10:46:50 -0700 > +Subject: [PATCH 1/2] include libgen.h for basename API prototype > + > +basename prototype has been removed from string.h from latest musl [1] > +compilers e.g. clang-18 flags the absense of prototype as error. therefore > +include libgen.h for providing it. > + > +[1] > https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 > + > +Upstream-Status: > [https://lore.kernel.org/fstests/20240325175323.3450750-1-raj.k...@gmail.com/T/#t] You forgot "Submitted" here. > +Signed-off-by: Khem Raj > +--- > + src/splice-test.c | 1 + > + src/stat_test.c | 1 + > + src/t_ext4_dax_inline_corruption.c | 1 + > + src/t_ext4_dax_journal_corruption.c | 1 + > + src/t_mmap_collision.c | 1 + > + 5 files changed, 5 insertions(+) > + > +diff --git a/src/splice-test.c b/src/splice-test.c > +index eb863673..7b7094f5 100644 > +--- a/src/splice-test.c > b/src/splice-test.c > +@@ -11,6 +11,7 @@ > + #include > + #include > + #include > ++#include > + > + #include > + #include > +diff --git a/src/stat_test.c b/src/stat_test.c > +index 95cfdc4f..77e1acdd 100644 > +--- a/src/stat_test.c > b/src/stat_test.c > +@@ -4,6 +4,7 @@ > + * Written by David Howells (dhowe...@redhat.com) > + */ > + > ++#include > + #include > + #include > + #include > +diff --git a/src/t_ext4_dax_inline_corruption.c > b/src/t_ext4_dax_inline_corruption.c > +index e1a39a6c..a40c5df5 100644 > +--- a/src/t_ext4_dax_inline_corruption.c > b/src/t_ext4_dax_inline_corruption.c > +@@ -2,6 +2,7 @@ > + /* Copyright (c) 2018 Intel Corporation. */ > + #include > + #include > ++#include > + #include > + #include > + #include > +diff --git a/src/t_ext4_dax_journal_corruption.c > b/src/t_ext4_dax_journal_corruption.c > +index ba7a96e4..53be10c2 100644 > +--- a/src/t_ext4_dax_journal_corruption.c > b/src/t_ext4_dax_journal_corruption.c > +@@ -2,6 +2,7 @@ > + /* Copyright (c) 2018 Intel Corporation. */ > + #include > + #include > ++#include > + #include > + #include > + #include > +diff --git a/src/t_mmap_collision.c b/src/t_mmap_collision.c > +index c872f4e2..d9315fcf 100644 > +--- a/src/t_mmap_collision.c > b/src/t_mmap_collision.c > +@@ -15,6 +15,7 @@ > + */ > + #include > + #include > ++#include > + #include > + #include > + #include > +-- > +2.44.0 > + > 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 00..20095c86ab > --- /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 @@ > +From 052818e91314b797d96d87672c60f6784160f935 Mon Sep 17 00:00:00 2001 > +From: Khem Raj > +Date: Mon, 25 Mar 2024 10:50:59 -0700 > +Subject: [PATCH 2/2] Add missing STATX_ATTR_* defines from musl sys/stat.h > + > +These defines are not provided by sys/stat.h on musl but are > +in glibc's sys/stat.h, therefore to compile the tests on musl > +based systems add the missing defines from linux/stat.h > +if they are not provided > + > +Upstream-Status: Submitted > [https://lore.kernel.org/fstests/20240325175323.3450750-2-raj.k...@gmail.com/T/#u] > +Signed-off-by: Khem Raj > +--- > + src/statx.h | 12 > + 1 file changed, 12 insertions(+) > + > +diff --git a/src/statx.h b/src/statx.h > +index 3f239d79..12599f5b 100644 > +--- a/src/statx.h > b/src/statx.h > +@@ -12,6 +12,18 @@ > + #define AT_STATX_DONT_SYNC 0x4000 /* - Don't sync attributes with the > server */ > + #endif > + > ++#ifndef STATX_ATTR_COMPRESSED > ++#define STATX_ATTR_COMPRESSED 0x0004 /* [I] Fi
[oe] [meta-filesystems][PATCH 2/2] xfstests: Fix build with musl >= 1.2.5
Signed-off-by: Khem Raj --- ...-libgen.h-for-basename-API-prototype.patch | 84 +++ ...X_ATTR_-defines-from-musl-sys-stat.h.patch | 42 ++ .../xfstests/xfstests_2024.03.03.bb | 2 + 3 files changed, 128 insertions(+) create mode 100644 meta-filesystems/recipes-utils/xfstests/xfstests/0001-include-libgen.h-for-basename-API-prototype.patch create mode 100644 meta-filesystems/recipes-utils/xfstests/xfstests/0002-Add-missing-STATX_ATTR_-defines-from-musl-sys-stat.h.patch 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 00..1f7ae32f04 --- /dev/null +++ b/meta-filesystems/recipes-utils/xfstests/xfstests/0001-include-libgen.h-for-basename-API-prototype.patch @@ -0,0 +1,84 @@ +From 37caab7a43da5ede0ff1eb700f0257a213ac4b18 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 25 Mar 2024 10:46:50 -0700 +Subject: [PATCH 1/2] include libgen.h for basename API prototype + +basename prototype has been removed from string.h from latest musl [1] +compilers e.g. clang-18 flags the absense of prototype as error. therefore +include libgen.h for providing it. + +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 + +Upstream-Status: [https://lore.kernel.org/fstests/20240325175323.3450750-1-raj.k...@gmail.com/T/#t] +Signed-off-by: Khem Raj +--- + src/splice-test.c | 1 + + src/stat_test.c | 1 + + src/t_ext4_dax_inline_corruption.c | 1 + + src/t_ext4_dax_journal_corruption.c | 1 + + src/t_mmap_collision.c | 1 + + 5 files changed, 5 insertions(+) + +diff --git a/src/splice-test.c b/src/splice-test.c +index eb863673..7b7094f5 100644 +--- a/src/splice-test.c b/src/splice-test.c +@@ -11,6 +11,7 @@ + #include + #include + #include ++#include + + #include + #include +diff --git a/src/stat_test.c b/src/stat_test.c +index 95cfdc4f..77e1acdd 100644 +--- a/src/stat_test.c b/src/stat_test.c +@@ -4,6 +4,7 @@ + * Written by David Howells (dhowe...@redhat.com) + */ + ++#include + #include + #include + #include +diff --git a/src/t_ext4_dax_inline_corruption.c b/src/t_ext4_dax_inline_corruption.c +index e1a39a6c..a40c5df5 100644 +--- a/src/t_ext4_dax_inline_corruption.c b/src/t_ext4_dax_inline_corruption.c +@@ -2,6 +2,7 @@ + /* Copyright (c) 2018 Intel Corporation. */ + #include + #include ++#include + #include + #include + #include +diff --git a/src/t_ext4_dax_journal_corruption.c b/src/t_ext4_dax_journal_corruption.c +index ba7a96e4..53be10c2 100644 +--- a/src/t_ext4_dax_journal_corruption.c b/src/t_ext4_dax_journal_corruption.c +@@ -2,6 +2,7 @@ + /* Copyright (c) 2018 Intel Corporation. */ + #include + #include ++#include + #include + #include + #include +diff --git a/src/t_mmap_collision.c b/src/t_mmap_collision.c +index c872f4e2..d9315fcf 100644 +--- a/src/t_mmap_collision.c b/src/t_mmap_collision.c +@@ -15,6 +15,7 @@ + */ + #include + #include ++#include + #include + #include + #include +-- +2.44.0 + 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 00..20095c86ab --- /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 @@ +From 052818e91314b797d96d87672c60f6784160f935 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 25 Mar 2024 10:50:59 -0700 +Subject: [PATCH 2/2] Add missing STATX_ATTR_* defines from musl sys/stat.h + +These defines are not provided by sys/stat.h on musl but are +in glibc's sys/stat.h, therefore to compile the tests on musl +based systems add the missing defines from linux/stat.h +if they are not provided + +Upstream-Status: Submitted [https://lore.kernel.org/fstests/20240325175323.3450750-2-raj.k...@gmail.com/T/#u] +Signed-off-by: Khem Raj +--- + src/statx.h | 12 + 1 file changed, 12 insertions(+) + +diff --git a/src/statx.h b/src/statx.h +index 3f239d79..12599f5b 100644 +--- a/src/statx.h b/src/statx.h +@@ -12,6 +12,18 @@ + #define AT_STATX_DONT_SYNC 0x4000 /* - Don't sync attributes with the server */ + #endif + ++#ifndef STATX_ATTR_COMPRESSED ++#define STATX_ATTR_COMPRESSED 0x0004 /* [I] File is compressed by the fs */ ++#define STATX_ATTR_IMMUTABLE 0x0010 /* [I] File is marked immutable */ ++#define STATX_ATTR_APPEND 0x0020 /* [I] File is append-only */ ++#define STATX_ATTR_NODUMP 0x0040 /* [I] File is not to be dumped */ ++#define STATX_ATTR_ENCRYPTED 0x0800 /* [I] File requires key to decry