* [PATCH v1] kbuild: Allow building of samples with UML
@ 2024-12-18 11:51 Mickaël Salaün
2025-02-11 7:48 ` Nicolas Schier
2025-02-11 9:44 ` Masahiro Yamada
0 siblings, 2 replies; 4+ messages in thread
From: Mickaël Salaün @ 2024-12-18 11:51 UTC (permalink / raw)
To: linux-kbuild, linux-um
Cc: Mickaël Salaün, linux-kselftest, linux-kernel,
Günther Noack, Anton Ivanov, Johannes Berg, Masahiro Yamada,
Nathan Chancellor, Nicolas Schier, Richard Weinberger
It's useful to build samples/* with UML and the only blocker is the
artificial incompatibility with CONFIG_HEADERS_INSTALL.
Allow the headers_install target with ARCH=um, which then allow building
samples (and tests using them) with UML too:
printf 'CONFIG_SAMPLES=y\nCONFIG_HEADERS_INSTALL=y\nCONFIG_SAMPLE_LANDLOCK=y\n' >.config
make ARCH=um olddefconfig headers_install
make ARCH=um samples/landlock/
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nicolas Schier <nicolas@fjasle.eu>
Cc: Richard Weinberger <richard@nod.at>
Fixes: 1b620d539ccc ("kbuild: disable header exports for UML in a straightforward way")
Signed-off-by: Mickaël Salaün <mic@digikod.net>
---
Makefile | 1 -
lib/Kconfig.debug | 1 -
2 files changed, 2 deletions(-)
diff --git a/Makefile b/Makefile
index e5b8a8832c0c..6e2cce16a2a3 100644
--- a/Makefile
+++ b/Makefile
@@ -1355,7 +1355,6 @@ hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj
PHONY += headers
headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders archscripts
- $(if $(filter um, $(SRCARCH)), $(error Headers not exportable for UML))
$(Q)$(MAKE) $(hdr-inst)=include/uapi
$(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index f3d723705879..fac1208f48e4 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -473,7 +473,6 @@ config READABLE_ASM
config HEADERS_INSTALL
bool "Install uapi headers to usr/include"
- depends on !UML
help
This option will install uapi headers (headers exported to user-space)
into the usr/include directory for use during the kernel build.
--
2.47.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1] kbuild: Allow building of samples with UML
2024-12-18 11:51 [PATCH v1] kbuild: Allow building of samples with UML Mickaël Salaün
@ 2025-02-11 7:48 ` Nicolas Schier
2025-02-11 9:44 ` Masahiro Yamada
1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Schier @ 2025-02-11 7:48 UTC (permalink / raw)
To: Mickaël Salaün
Cc: linux-kbuild, linux-um, linux-kselftest, linux-kernel,
Günther Noack, Anton Ivanov, Johannes Berg, Masahiro Yamada,
Nathan Chancellor, Richard Weinberger, Nicolas Schier
On Wed, Dec 18, 2024 at 12:51:23PM +0100, Mickaël Salaün wrote:
> It's useful to build samples/* with UML and the only blocker is the
> artificial incompatibility with CONFIG_HEADERS_INSTALL.
>
> Allow the headers_install target with ARCH=um, which then allow building
> samples (and tests using them) with UML too:
>
> printf 'CONFIG_SAMPLES=y\nCONFIG_HEADERS_INSTALL=y\nCONFIG_SAMPLE_LANDLOCK=y\n' >.config
> make ARCH=um olddefconfig headers_install
> make ARCH=um samples/landlock/
>
> Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: Nicolas Schier <nicolas@fjasle.eu>
> Cc: Richard Weinberger <richard@nod.at>
> Fixes: 1b620d539ccc ("kbuild: disable header exports for UML in a straightforward way")
> Signed-off-by: Mickaël Salaün <mic@digikod.net>
> ---
> Makefile | 1 -
> lib/Kconfig.debug | 1 -
> 2 files changed, 2 deletions(-)
>
Thanks, looks good to me.
Reviewed-by: Nicolas Schier <n.schier@avm.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] kbuild: Allow building of samples with UML
2024-12-18 11:51 [PATCH v1] kbuild: Allow building of samples with UML Mickaël Salaün
2025-02-11 7:48 ` Nicolas Schier
@ 2025-02-11 9:44 ` Masahiro Yamada
2025-02-11 10:50 ` Nicolas Schier
1 sibling, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2025-02-11 9:44 UTC (permalink / raw)
To: Mickaël Salaün
Cc: linux-kbuild, linux-um, linux-kselftest, linux-kernel,
Günther Noack, Anton Ivanov, Johannes Berg,
Nathan Chancellor, Nicolas Schier, Richard Weinberger
On Wed, Dec 18, 2024 at 8:51 PM Mickaël Salaün <mic@digikod.net> wrote:
>
> It's useful to build samples/* with UML and the only blocker is the
> artificial incompatibility with CONFIG_HEADERS_INSTALL.
>
> Allow the headers_install target with ARCH=um, which then allow building
> samples (and tests using them) with UML too:
>
> printf 'CONFIG_SAMPLES=y\nCONFIG_HEADERS_INSTALL=y\nCONFIG_SAMPLE_LANDLOCK=y\n' >.config
> make ARCH=um olddefconfig headers_install
> make ARCH=um samples/landlock/
>
> Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: Nicolas Schier <nicolas@fjasle.eu>
> Cc: Richard Weinberger <richard@nod.at>
> Fixes: 1b620d539ccc ("kbuild: disable header exports for UML in a straightforward way")
> Signed-off-by: Mickaël Salaün <mic@digikod.net>
> ---
> Makefile | 1 -
> lib/Kconfig.debug | 1 -
> 2 files changed, 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index e5b8a8832c0c..6e2cce16a2a3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1355,7 +1355,6 @@ hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj
>
> PHONY += headers
> headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders archscripts
> - $(if $(filter um, $(SRCARCH)), $(error Headers not exportable for UML))
> $(Q)$(MAKE) $(hdr-inst)=include/uapi
> $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi
>
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index f3d723705879..fac1208f48e4 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -473,7 +473,6 @@ config READABLE_ASM
>
> config HEADERS_INSTALL
> bool "Install uapi headers to usr/include"
> - depends on !UML
> help
> This option will install uapi headers (headers exported to user-space)
> into the usr/include directory for use during the kernel build.
> --
> 2.47.1
>
This patch was not even compile-tested.
Apply this patch.
Enable CONFIG_HEADERS_INSTALL and CONFIG_UAPI_HEADERS_TEST.
"make ARCH=um" and see the errors.
The reason is obvious, UML is a kernel. No such userspace.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] kbuild: Allow building of samples with UML
2025-02-11 9:44 ` Masahiro Yamada
@ 2025-02-11 10:50 ` Nicolas Schier
0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Schier @ 2025-02-11 10:50 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-kbuild, linux-um, linux-kselftest, linux-kernel,
Günther Noack, Anton Ivanov, Johannes Berg,
Nathan Chancellor, Richard Weinberger, Nicolas Schier,
Mickaël Salaün
On Tue, Feb 11, 2025 at 06:44:30PM +0900, Masahiro Yamada wrote:
> On Wed, Dec 18, 2024 at 8:51 PM Mickaël Salaün <mic@digikod.net> wrote:
> >
> > It's useful to build samples/* with UML and the only blocker is the
> > artificial incompatibility with CONFIG_HEADERS_INSTALL.
> >
> > Allow the headers_install target with ARCH=um, which then allow building
> > samples (and tests using them) with UML too:
> >
> > printf 'CONFIG_SAMPLES=y\nCONFIG_HEADERS_INSTALL=y\nCONFIG_SAMPLE_LANDLOCK=y\n' >.config
> > make ARCH=um olddefconfig headers_install
> > make ARCH=um samples/landlock/
> >
> > Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
> > Cc: Johannes Berg <johannes@sipsolutions.net>
> > Cc: Masahiro Yamada <masahiroy@kernel.org>
> > Cc: Nathan Chancellor <nathan@kernel.org>
> > Cc: Nicolas Schier <nicolas@fjasle.eu>
> > Cc: Richard Weinberger <richard@nod.at>
> > Fixes: 1b620d539ccc ("kbuild: disable header exports for UML in a straightforward way")
> > Signed-off-by: Mickaël Salaün <mic@digikod.net>
> > ---
> > Makefile | 1 -
> > lib/Kconfig.debug | 1 -
> > 2 files changed, 2 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index e5b8a8832c0c..6e2cce16a2a3 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1355,7 +1355,6 @@ hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj
> >
> > PHONY += headers
> > headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders archscripts
> > - $(if $(filter um, $(SRCARCH)), $(error Headers not exportable for UML))
> > $(Q)$(MAKE) $(hdr-inst)=include/uapi
> > $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi
> >
> > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> > index f3d723705879..fac1208f48e4 100644
> > --- a/lib/Kconfig.debug
> > +++ b/lib/Kconfig.debug
> > @@ -473,7 +473,6 @@ config READABLE_ASM
> >
> > config HEADERS_INSTALL
> > bool "Install uapi headers to usr/include"
> > - depends on !UML
> > help
> > This option will install uapi headers (headers exported to user-space)
> > into the usr/include directory for use during the kernel build.
> > --
> > 2.47.1
> >
>
> This patch was not even compile-tested.
>
> Apply this patch.
> Enable CONFIG_HEADERS_INSTALL and CONFIG_UAPI_HEADERS_TEST.
> "make ARCH=um" and see the errors.
>
> The reason is obvious, UML is a kernel. No such userspace.
oh, I sorry. I should have seen that when reviewing, but confused
myself as I missed the UAPI_HEADERS_TEST and just looked at a
"successful" run of 'make headers_install'.
Kind regards,
Nicolas
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-11 10:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-18 11:51 [PATCH v1] kbuild: Allow building of samples with UML Mickaël Salaün
2025-02-11 7:48 ` Nicolas Schier
2025-02-11 9:44 ` Masahiro Yamada
2025-02-11 10:50 ` Nicolas Schier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox