[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNATuekKKAtp7W+vzwEmaPW52YzPzqTfrJNKpXPV1kGhR8g@mail.gmail.com>
Date: Tue, 11 Feb 2025 18:44:30 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Mickaël Salaün <mic@...ikod.net>
Cc: linux-kbuild@...r.kernel.org, linux-um@...ts.infradead.org,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
Günther Noack <gnoack@...gle.com>,
Anton Ivanov <anton.ivanov@...bridgegreys.com>, Johannes Berg <johannes@...solutions.net>,
Nathan Chancellor <nathan@...nel.org>, Nicolas Schier <nicolas@...sle.eu>,
Richard Weinberger <richard@....at>
Subject: Re: [PATCH v1] kbuild: Allow building of samples with UML
On Wed, Dec 18, 2024 at 8:51 PM Mickaël Salaün <mic@...ikod.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@...bridgegreys.com>
> Cc: Johannes Berg <johannes@...solutions.net>
> Cc: Masahiro Yamada <masahiroy@...nel.org>
> Cc: Nathan Chancellor <nathan@...nel.org>
> Cc: Nicolas Schier <nicolas@...sle.eu>
> Cc: Richard Weinberger <richard@....at>
> Fixes: 1b620d539ccc ("kbuild: disable header exports for UML in a straightforward way")
> Signed-off-by: Mickaël Salaün <mic@...ikod.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
Powered by blists - more mailing lists