From f39c709957e591d5dc93001121094f3616503e6e Mon Sep 17 00:00:00 2001
From: Anders Roxell <anders.roxell@linaro.org>
Date: Wed, 19 Dec 2018 13:12:05 +0100
Subject: [PATCH] samples: Kconfig: readd BROKEN to SAMPLE_VFS
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

SHA c1cae12e6b4a ("vfs: Add a sample program for the new mount API")
introduced a build error (regression) when building an allmodconfig
kernel. Before that patch it 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_VFS depends on BROKEN, that forces SAMPLE_VFS to
be disabled.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 samples/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/samples/Kconfig b/samples/Kconfig
index dc4eb5355fad..c83741b9d87e 100644
--- a/samples/Kconfig
+++ b/samples/Kconfig
@@ -149,6 +149,7 @@ config SAMPLE_VFIO_MDEV_MBOCHS
 
 config SAMPLE_VFS
 	bool "Build example programs that use new VFS system calls"
+	depends on BROKEN
 	help
 	  Build example userspace programs that use new VFS system calls such
 	  as mount API and statx().  Note that this is restricted to the x86
-- 
2.19.2

