linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] samples: fix binderfs sample
@ 2020-04-28 21:25 Arnd Bergmann
  2020-04-29  3:53 ` Masahiro Yamada
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Arnd Bergmann @ 2020-04-28 21:25 UTC (permalink / raw)
  To: Christian Brauner, Jonathan Corbet
  Cc: Arnd Bergmann, Christian Brauner, Masahiro Yamada,
	Steven Rostedt (VMware),
	linux-kernel

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.

Fixes: 9762dc1432e1 ("samples: add binderfs sample program")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 samples/Kconfig           | 2 +-
 samples/binderfs/Makefile | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/samples/Kconfig b/samples/Kconfig
index 5c31971a5745..e0b747cc90c9 100644
--- a/samples/Kconfig
+++ b/samples/Kconfig
@@ -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.
diff --git a/samples/binderfs/Makefile b/samples/binderfs/Makefile
index ea4c93d36256..a3ac5476338a 100644
--- a/samples/binderfs/Makefile
+++ b/samples/binderfs/Makefile
@@ -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
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] samples: fix binderfs sample
  2020-04-28 21:25 [PATCH] samples: fix binderfs sample Arnd Bergmann
@ 2020-04-29  3:53 ` Masahiro Yamada
  2020-04-29  8:01 ` Christian Brauner
  2020-05-05 23:54 ` Masahiro Yamada
  2 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-04-29  3:53 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Christian Brauner, Jonathan Corbet, Christian Brauner,
	Steven Rostedt (VMware),
	Linux Kernel Mailing List

Hi Arnd,


On Wed, Apr 29, 2020 at 6:26 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> 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.
>
> Fixes: 9762dc1432e1 ("samples: add binderfs sample program")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

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.




-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] samples: fix binderfs sample
  2020-04-28 21:25 [PATCH] samples: fix binderfs sample Arnd Bergmann
  2020-04-29  3:53 ` Masahiro Yamada
@ 2020-04-29  8:01 ` Christian Brauner
  2020-05-05 15:48   ` Jonathan Corbet
  2020-05-05 23:54 ` Masahiro Yamada
  2 siblings, 1 reply; 5+ messages in thread
From: Christian Brauner @ 2020-04-29  8:01 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Christian Brauner, Jonathan Corbet, Masahiro Yamada,
	Steven Rostedt (VMware),
	linux-kernel

On Tue, Apr 28, 2020 at 11:25:33PM +0200, Arnd Bergmann wrote:
> 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.
> 
> Fixes: 9762dc1432e1 ("samples: add binderfs sample program")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks for fixing this Arnd!
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] samples: fix binderfs sample
  2020-04-29  8:01 ` Christian Brauner
@ 2020-05-05 15:48   ` Jonathan Corbet
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Corbet @ 2020-05-05 15:48 UTC (permalink / raw)
  To: Christian Brauner
  Cc: Arnd Bergmann, Christian Brauner, Masahiro Yamada,
	Steven Rostedt (VMware),
	linux-kernel

On Wed, 29 Apr 2020 10:01:13 +0200
Christian Brauner <christian.brauner@ubuntu.com> wrote:

> On Tue, Apr 28, 2020 at 11:25:33PM +0200, Arnd Bergmann wrote:
> > 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.
> > 
> > Fixes: 9762dc1432e1 ("samples: add binderfs sample program")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>  
> 
> Thanks for fixing this Arnd!
> Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
> 
I've applied this, thanks.

jon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] samples: fix binderfs sample
  2020-04-28 21:25 [PATCH] samples: fix binderfs sample Arnd Bergmann
  2020-04-29  3:53 ` Masahiro Yamada
  2020-04-29  8:01 ` Christian Brauner
@ 2020-05-05 23:54 ` Masahiro Yamada
  2 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-05-05 23:54 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Christian Brauner, Jonathan Corbet, Christian Brauner,
	Steven Rostedt (VMware),
	Linux Kernel Mailing List

Hi Arnd,


On Wed, Apr 29, 2020 at 6:26 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> 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.
>
> Fixes: 9762dc1432e1 ("samples: add binderfs sample program")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  samples/Kconfig           | 2 +-
>  samples/binderfs/Makefile | 6 +++++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/samples/Kconfig b/samples/Kconfig
> index 5c31971a5745..e0b747cc90c9 100644
> --- a/samples/Kconfig
> +++ b/samples/Kconfig
> @@ -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.
> diff --git a/samples/binderfs/Makefile b/samples/binderfs/Makefile
> index ea4c93d36256..a3ac5476338a 100644
> --- a/samples/binderfs/Makefile
> +++ b/samples/binderfs/Makefile
> @@ -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
> --
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-05 23:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 21:25 [PATCH] samples: fix binderfs sample Arnd Bergmann
2020-04-29  3:53 ` Masahiro Yamada
2020-04-29  8:01 ` Christian Brauner
2020-05-05 15:48   ` Jonathan Corbet
2020-05-05 23:54 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).