samples: Kconfig: readd BROKEN to SAMPLE_STATX
PATCH 1/1 samples: Kconfig: readd BROKEN to SAMPLE_STATX
Commit c1cae12e6b4a ("vfs: Add a sample program for the new mount API") introduced a build error (regression) when building an allmodconfig kernel. Before that SAMPLE_STATX had a "depends on BROKEN", and it got removed in the patch.
When building an allmodconfig kernel, option SAMPLE_VFS gets enabled and produce the following build error:
In file included from /usr/include/x86_64-linux-gnu/sys/stat.h:446,
from ../samples/vfs/test-statx.c:28:
/usr/include/x86_64-linux-gnu/bits/statx.h:25:8: error: redefinition of ‘struct statx_timestamp’
struct statx_timestamp
^~~~~~~~~~~~~~~
In file included from ../samples/vfs/test-statx.c:26:
./usr/include/linux/stat.h:56:8: note: originally defined here
struct statx_timestamp {
^~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/stat.h:446,
from ../samples/vfs/test-statx.c:28:
/usr/include/x86_64-linux-gnu/bits/statx.h:36:8: error: redefinition of ‘struct statx’
struct statx
^~~~~
In file included from ../samples/vfs/test-statx.c:26:
./usr/include/linux/stat.h:99:8: note: originally defined here
struct statx {
^~~~~
../samples/vfs/test-statx.c:40:9: error: conflicting types for ‘statx’
ssize_t statx(int dfd, const char *filename, unsigned flags,
^~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/stat.h:446,
from ../samples/vfs/test-statx.c:28:
/usr/include/x86_64-linux-gnu/bits/statx.h:87:5: note: previous declaration of ‘statx’ was here
int statx (int __dirfd, const char *__restrict __path, int __flags,
^~~~~make[3]: *** [scripts/Makefile.host:90: samples/vfs/test-statx] Error 1 make[3]: Target '__build' not remade because of errors. make[2]: *** [../scripts/Makefile.build:492: samples/vfs] Error 2 make[2]: Target '__build' not remade because of errors. make[1]: *** [/srv/src/kernel/testing/Makefile:1065: samples] Error 2
Rework so that SAMPLE_STATX depends on BROKEN, and SAMPLE_VFS enables the newly added test.
--- samples/Kconfig | 7 +++++++ samples/vfs/Makefile | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-)
samples/Kconfig +7 -0
@@ -147,6 +147,13 @@ config SAMPLE_VFIO_MDEV_MBOCHS Specifically it does *not* include any legacy vga stuff. Device looks a lot like "qemu -device secondary-vga". +config SAMPLE_STATX + bool "Build example extended-stat using code" + depends on BROKEN + depends on SAMPLE_VFS + help + Build example userspace program to use the new extended-stat syscall. + config SAMPLE_VFS bool "Build example programs that use new VFS system calls" help
samples/vfs/Makefile +2 -1
@@ -1,6 +1,7 @@ # List of programs to build hostprogs-$(CONFIG_SAMPLE_VFS) := \ - test-fsmount \ + test-fsmount +hostprogs-$(CONFIG_SAMPLE_STATX) := \ test-statx # Tell kbuild to always build the programs
Signature · 1 line
2.19.2