LKML Archive on lore.kernel.org
 help / Atom feed
From: Anders Roxell <anders.roxell@linaro.org>
To: dhowells@redhat.com, viro@zeniv.linux.org.uk
Cc: linux-kernel@vger.kernel.org, Anders Roxell <anders.roxell@linaro.org>
Subject: [PATCH] samples: Kconfig: readd BROKEN to SAMPLE_STATX
Date: Wed, 19 Dec 2018 15:00:40 +0100
Message-ID: <20181219140040.8637-1-anders.roxell@linaro.org> (raw)

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.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 samples/Kconfig      | 7 +++++++
 samples/vfs/Makefile | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/samples/Kconfig b/samples/Kconfig
index dc4eb5355fad..8253c8ce7632 100644
--- a/samples/Kconfig
+++ b/samples/Kconfig
@@ -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
diff --git a/samples/vfs/Makefile b/samples/vfs/Makefile
index 4ac9690fb3c4..fe510c6d5e52 100644
--- a/samples/vfs/Makefile
+++ b/samples/vfs/Makefile
@@ -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
-- 
2.19.2


                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181219140040.8637-1-anders.roxell@linaro.org \
    --to=anders.roxell@linaro.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox