.gitignore: prefix local generated files with a slashThe pattern prefixed with '/' matches files in the same directory,but not ones in sub-directories.Signed-off-by: Masahiro Yamada <masahiroy@k
.gitignore: prefix local generated files with a slashThe pattern prefixed with '/' matches files in the same directory,but not ones in sub-directories.Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>Acked-by: Miguel Ojeda <ojeda@kernel.org>Acked-by: Rob Herring <robh@kernel.org>Acked-by: Andra Paraschiv <andraprs@amazon.com>Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>Acked-by: Gabriel Krisman Bertazi <krisman@collabora.com>
show more ...
kbuild: introduce hostprogs-always-y and userprogs-always-yTo build host programs, you need to add the program names to 'hostprogs'to use the necessary build rule, but it is not enough to build th
kbuild: introduce hostprogs-always-y and userprogs-always-yTo build host programs, you need to add the program names to 'hostprogs'to use the necessary build rule, but it is not enough to build thembecause there is no dependency.There are two types of host programs: built as the prerequisite ofanother (e.g. gen_crc32table in lib/Makefile), or always built whenKbuild visits the Makefile (e.g. genksyms in scripts/genksyms/Makefile).The latter is typical in Makefiles under scripts/, which contains hostprograms globally used during the kernel build. To build them, you needto add them to both 'hostprogs' and 'always-y'.This commit adds hostprogs-always-y as a shorthand.The same applies to user programs. net/bpfilter/Makefile buildsbpfilter_umh on demand, hence always-y is unneeded. In contrast,programs under samples/ are added to both 'userprogs' and 'always-y'so they are always built when Kbuild visits the Makefiles.userprogs-always-y works as a shorthand.Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
binderfs: add gitignore for generated sample programLet's keep "git status" happy and quiet.Fixes: 9762dc1432e1 ("samples: add binderfs sample programFixes: fca5e94921d5 ("samples: binderfs: rea
binderfs: add gitignore for generated sample programLet's keep "git status" happy and quiet.Fixes: 9762dc1432e1 ("samples: add binderfs sample programFixes: fca5e94921d5 ("samples: binderfs: really compile this sample and fix build issues")Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
samples: binderfs: really compile this sample and fix build issuesEven after commit c624adc9cb6e ("samples: fix binderfs sample"), thissample is never compiled.'hostprogs' teaches Kbuild that th
samples: binderfs: really compile this sample and fix build issuesEven after commit c624adc9cb6e ("samples: fix binderfs sample"), thissample is never compiled.'hostprogs' teaches Kbuild that this is a host program, but not enoughto order to compile it. You must add it to 'always-y' to really compileit.Since this sample has never been compiled in upstream, various issuesare left unnoticed.[1] compilers without <linux/android/binderfs.h> are still widely used<linux/android/binderfs.h> is only available since commit c13295ad219d("binderfs: rename header to binderfs.h"), i.e., Linux 5.0If your compiler is based on UAPI headers older than Linux 5.0, youwill see the following error: samples/binderfs/binderfs_example.c:16:10: fatal error: linux/android/binderfs.h: No such file or directory #include <linux/android/binderfs.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.You cannot rely on compilers having such a new header.The common approach is to install UAPI headers of this kernel intousr/include, and then add it to the header search path.I added 'depends on HEADERS_INSTALL' in Kconfig, and '-I usr/include'compiler flag in Makefile.[2] compile the sample for target architectureBecause headers_install works for the target architecture, only thenative compiler was able to build sample code that requires'-I usr/include'.Commit 7f3a59db274c ("kbuild: add infrastructure to build userspaceprograms") added the new syntax 'userprogs' to compile user-spaceprograms for the target architecture.Use it, and then 'ifndef CROSS_COMPILE' will go away.I added 'depends on CC_CAN_LINK' because $(CC) is not necessarilycapable of linking user-space programs.[3] use subdir-y to descend into samples/binderfsSince this directory does not contain any kernel-space code, it has nopoint in generating built-in.a or modules.order.Replace obj-$(CONFIG_...) with subdir-$(CONFIG_...).[4] -Wunused-variable warningIf I compile this, I see the following warning. samples/binderfs/binderfs_example.c: In function 'main': samples/binderfs/binderfs_example.c:21:9: warning: unused variable 'len' [-Wunused-variable] 21 | size_t len; | ^~~I removed the unused 'len'.[5] CONFIG_ANDROID_BINDERFS is not requiredSince this is a user-space standalone program, it is independent ofthe kernel configuration.Remove 'depends on ANDROID_BINDERFS'.Fixes: 9762dc1432e1 ("samples: add binderfs sample program")Fixes: c624adc9cb6e ("samples: fix binderfs sample")Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
samples: fix binderfs sampleA routine check for misspelled Kconfig symbols showed on instancefrom last year, the correct symbol name is CONFIG_ANDROID_BINDERFS,not CONFIG_CONFIG_ANDROID_BINDERFS,
samples: fix binderfs sampleA routine check for misspelled Kconfig symbols showed on instancefrom last year, the correct symbol name is CONFIG_ANDROID_BINDERFS,not CONFIG_CONFIG_ANDROID_BINDERFS, so the extra prefix mustbe removed in the Kconfig file to allow enabling the sample.As the actual sample fails to build as a kernel module, change theMakefile enough to get to build as a hostprog instead.Fixes: 9762dc1432e1 ("samples: add binderfs sample program")Signed-off-by: Arnd Bergmann <arnd@arndb.de>Acked-by: Christian Brauner <christian.brauner@ubuntu.com>Link: https://lore.kernel.org/r/20200428212555.2806258-1-arnd@arndb.deSigned-off-by: Jonathan Corbet <corbet@lwn.net>
treewide: Add SPDX license identifier - Makefile/KconfigAdd SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any formThese files fall under the project
treewide: Add SPDX license identifier - Makefile/KconfigAdd SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any formThese files fall under the project license, GPL v2 only. The resulting SPDXlicense identifier is: GPL-2.0-onlySigned-off-by: Thomas Gleixner <tglx@linutronix.de>Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
samples: add binderfs sample programThis adds a simple sample program mounting binderfs and adding, thenremoving a binder device. Hopefully, it will be helpful to users who wantto know how binde
samples: add binderfs sample programThis adds a simple sample program mounting binderfs and adding, thenremoving a binder device. Hopefully, it will be helpful to users who wantto know how binderfs is supposed to be used.Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>Signed-off-by: Jonathan Corbet <corbet@lwn.net>