summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-04-29 05:45:22 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2020-05-17 11:52:02 +0200
commit28949b84b2cb2473507ec2fed06728f995dd7942 (patch)
tree849d597e58bb9678e12f869a7cbc5cd97f87348b
parentsamples: connector: build sample program for target architecture (diff)
downloadlinux-28949b84b2cb2473507ec2fed06728f995dd7942.tar.xz
linux-28949b84b2cb2473507ec2fed06728f995dd7942.zip
samples: vfs: build sample programs for target architecture
These userspace programs include UAPI headers exported to usr/include/. 'make headers' always works for the target architecture (i.e. the same architecture as the kernel), so the sample programs should be built for the target as well. Kbuild now supports 'userprogs' for that. I also guarded the CONFIG option by 'depends on CC_CAN_LINK' because $(CC) may not provide libc. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Sam Ravnborg <sam@ravnborg.org>
-rw-r--r--samples/Kconfig2
-rw-r--r--samples/vfs/Makefile11
2 files changed, 4 insertions, 9 deletions
diff --git a/samples/Kconfig b/samples/Kconfig
index 08f2d025ca05..831a7ecd3352 100644
--- a/samples/Kconfig
+++ b/samples/Kconfig
@@ -184,7 +184,7 @@ config SAMPLE_ANDROID_BINDERFS
config SAMPLE_VFS
bool "Build example programs that use new VFS system calls"
- depends on HEADERS_INSTALL
+ depends on CC_CAN_LINK && HEADERS_INSTALL
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
diff --git a/samples/vfs/Makefile b/samples/vfs/Makefile
index 65acdde5c117..00b6824f9237 100644
--- a/samples/vfs/Makefile
+++ b/samples/vfs/Makefile
@@ -1,10 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
-# List of programs to build
-hostprogs := \
- test-fsmount \
- test-statx
+userprogs := test-fsmount test-statx
+always-y := $(userprogs)
-always-y := $(hostprogs)
-
-HOSTCFLAGS_test-fsmount.o += -I$(objtree)/usr/include
-HOSTCFLAGS_test-statx.o += -I$(objtree)/usr/include
+userccflags += -I usr/include