]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
kbuild: implement CONFIG_HEADERS_INSTALL for Usermode Linux
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Mon, 17 Feb 2025 10:59:21 +0000 (11:59 +0100)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 15 Mar 2025 12:19:44 +0000 (21:19 +0900)
userprogs sometimes need access to UAPI headers.
This is currently not possible for Usermode Linux, as UM is only
a pseudo architecture built on top of a regular architecture and does
not have its own UAPI.
Instead use the UAPI headers from the underlying regular architecture.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Makefile
lib/Kconfig.debug

index 3428e46300695f4c4bf39a40acdad55b4b8bdc5f..f2ec8d05c0f54e0b34b9dabfbaf71984f86c4ae0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1361,9 +1361,12 @@ 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))
+ifdef HEADER_ARCH
+       $(Q)$(MAKE) -f $(srctree)/Makefile HEADER_ARCH= SRCARCH=$(HEADER_ARCH) headers
+else
        $(Q)$(MAKE) $(hdr-inst)=include/uapi
        $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi
+endif
 
 ifdef CONFIG_HEADERS_INSTALL
 prepare: headers
index 35796c290ca351b9906dc37651197aefb9100990..17ccd913975dabcaa128bfa345dffab8324f13c9 100644 (file)
@@ -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.