samples: fix binderfs sample
PATCH 1/1 samples: fix binderfs sample
A routine check for misspelled Kconfig symbols showed on instance from last year, the correct symbol name is CONFIG_ANDROID_BINDERFS, not CONFIG_CONFIG_ANDROID_BINDERFS, so the extra prefix must be removed in the Kconfig file to allow enabling the sample.
As the actual sample fails to build as a kernel module, change the Makefile enough to get to build as a hostprog instead.
--- samples/Kconfig | 2 +- samples/binderfs/Makefile | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-)
samples/Kconfig +1 -1
@@ -171,7 +171,7 @@ config SAMPLE_VFIO_MDEV_MBOCHS config SAMPLE_ANDROID_BINDERFS bool "Build Android binderfs example" - depends on CONFIG_ANDROID_BINDERFS + depends on ANDROID_BINDERFS help Builds a sample program to illustrate the use of the Android binderfs filesystem.
samples/binderfs/Makefile +5 -1
@@ -1,2 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_SAMPLE_ANDROID_BINDERFS) += binderfs_example.o +ifndef CROSS_COMPILE +ifdef CONFIG_SAMPLE_ANDROID_BINDERFS +hostprogs := binderfs_example +endif +endif
Signature · 1 line
2.26.0
Hi Arnd,
Quoted 6 lines · Arnd Bergmann
A routine check for misspelled
Kconfigsymbols showed on instance from last year, the correct symbol name isCONFIG_ANDROID_BINDERFS, notCONFIG_CONFIG_ANDROID_BINDERFS, so the extra prefix must be removed in theKconfigfile to allow enabling the sample.
Quoted 6 lines
As the actual sample fails to build as a kernel module, change the
Makefileenough to get to build as a hostprog instead.Fixes 9762dc1432e1 ("samples: add binderfs sample program")Signed-off-by Arnd Bergmann <[email protected]>---
Nice catch!
I am working on a new syntax 'userprogs'.
This builds programs for the target architecture
instead of the host.
Once, my series lands,
you can use 'userprogs', like this:
https://patchwork.kernel.org/patch/11515977/
Then 'ifndef CROSS_COMPILE' will go away.
Signature · 2 lines
Best Regards Masahiro Yamada
Quoted 10 lines · Arnd Bergmann
A routine check for misspelled
Kconfigsymbols showed on instance from last year, the correct symbol name isCONFIG_ANDROID_BINDERFS, notCONFIG_CONFIG_ANDROID_BINDERFS, so the extra prefix must be removed in theKconfigfile to allow enabling the sample.As the actual sample fails to build as a kernel module, change the
Makefileenough to get to build as a hostprog instead.Fixes 9762dc1432e1 ("samples: add binderfs sample program")Signed-off-by Arnd Bergmann <[email protected]>
Thanks for fixing this Arnd!
Jonathan Corbet
AppliedQuoted 6 lines · On Wed, 29 Apr 2020 10:01:13 +0200 Christian Brauner…
Quoted 5 lines · Arnd Bergmann
A routine check for misspelled
Kconfigsymbols showed on instance from last year, the correct symbol name isCONFIG_ANDROID_BINDERFS, notCONFIG_CONFIG_ANDROID_BINDERFS, so the extra prefix must be removed in theKconfigfile to allow enabling the sample.
Quoted 9 lines
Quoted 5 lines
As the actual sample fails to build as a kernel module, change the
Makefileenough to get to build as a hostprog instead.Fixes 9762dc1432e1 ("samples: add binderfs sample program")Signed-off-by Arnd Bergmann <[email protected]>Thanks for fixing this Arnd!
I've applied this, thanks.
jon
Hi Arnd,
Quoted 42 lines · Arnd Bergmann
A routine check for misspelled
Kconfigsymbols showed on instance from last year, the correct symbol name isCONFIG_ANDROID_BINDERFS, notCONFIG_CONFIG_ANDROID_BINDERFS, so the extra prefix must be removed in theKconfigfile to allow enabling the sample.As the actual sample fails to build as a kernel module, change the
Makefileenough to get to build as a hostprog instead.Fixes 9762dc1432e1 ("samples: add binderfs sample program")Signed-off-by Arnd Bergmann <[email protected]>--- samples/Kconfig | 2 +- samples/binderfs/Makefile | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-)samples/Kconfig +1
-1@@ -171,7 +171,7 @@ config SAMPLE_VFIO_MDEV_MBOCHS config SAMPLE_ANDROID_BINDERFS bool "Build Android binderfs example" - depends on CONFIG_ANDROID_BINDERFS + depends on ANDROID_BINDERFS help Builds a sample program to illustrate the use of the Android binderfs filesystem.samples/binderfs/Makefile +5
-2@@ -1,2 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_SAMPLE_ANDROID_BINDERFS) += binderfs_example.o +ifndef CROSS_COMPILE +ifdef CONFIG_SAMPLE_ANDROID_BINDERFS +hostprogs := binderfs_example +endif +endif --
Quoted 2 lines
2.26.0
binderfs_example.c includes <linux/android/binderfs.h>.
This uapi header is very new.
include/uapi/linux/android/binderfs.h was added by commit c13295ad219d8bb0e47942d4cfc8251de449a67e i.e. Linux 5.0
If this sample is compiled by a compiler with kernel headers older than Linux 5.0, it will fail to build.
Documentation/process/changes.rst defines the minumal GCC version, but the minimal kernel header version is undefined.
Is there any criteria when to add
'-I usr/include' ?
At least, this is this case, I think.
--
Best Regards
Masahiro Yamada