* [Buildroot] [PATCH 08/23] package: use <pkg>_SRCSUBDIR where <pkg>_SRCDIR used to include _SUBDIR
2026-10-23 21:51 ` Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 09/23] linux: build out of tree when LINUX_OVERRIDE_SRCDIR is set Florian Fainelli via buildroot
` (14 subsequent siblings)
15 siblings, 0 replies; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Eric Le Bihan, Gary Bisson, Jérôme Pouiller,
Florian Fainelli, Bernd Kuhls, Thomas Perale, Maxime Chevallier,
Refik Tuzakli, Francois Perrad, Thomas Petazzoni,
Arnout Vandecappelle, Petr Vorel, Spenser Gilliland,
Giulio Benetti, Pascal de Bruijn, Luca Ceresoli, Romain Naour,
Mahyar Koshkouei
With <pkg>_SRCDIR no longer including <pkg>_SUBDIR, convert the
infrastructures and packages that relied on the old meaning (cargo,
hare, luarocks, meson, perl, waf, gcc-final) to <pkg>_SRCSUBDIR.
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
package/gcc/gcc-final/gcc-final.mk | 2 +-
package/pkg-cargo.mk | 8 ++++----
package/pkg-hare.mk | 8 ++++----
package/pkg-luarocks.mk | 4 ++--
package/pkg-meson.mk | 26 +++++++++++++-------------
package/pkg-perl.mk | 12 ++++++------
package/pkg-waf.mk | 8 ++++----
7 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
index 97a64ae2fabf..570636a81dfe 100644
--- a/package/gcc/gcc-final/gcc-final.mk
+++ b/package/gcc/gcc-final/gcc-final.mk
@@ -51,7 +51,7 @@ HOST_GCC_FINAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK
# So we must completely override the generic commands and provide our own.
#
define HOST_GCC_FINAL_CONFIGURE_CMDS
- (cd $(HOST_GCC_FINAL_SRCDIR) && rm -rf config.cache; \
+ (cd $(HOST_GCC_FINAL_SRCSUBDIR) && rm -rf config.cache; \
$(HOST_CONFIGURE_OPTS) \
CFLAGS="$(HOST_CFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)" \
diff --git a/package/pkg-cargo.mk b/package/pkg-cargo.mk
index 47a6353f2592..aae6eb9b61aa 100644
--- a/package/pkg-cargo.mk
+++ b/package/pkg-cargo.mk
@@ -234,7 +234,7 @@ endif
ifndef $(2)_BUILD_CMDS
ifeq ($(4),target)
define $(2)_BUILD_CMDS
- cd $$($$(PKG)_SRCDIR) && \
+ cd $$($$(PKG)_SRCSUBDIR) && \
$$(TARGET_MAKE_ENV) \
$$(TARGET_CONFIGURE_OPTS) \
$$(PKG_CARGO_ENV) \
@@ -248,7 +248,7 @@ define $(2)_BUILD_CMDS
endef
else # ifeq ($(4),target)
define $(2)_BUILD_CMDS
- cd $$($$(PKG)_SRCDIR) && \
+ cd $$($$(PKG)_SRCSUBDIR) && \
$$(HOST_MAKE_ENV) \
$$(HOST_CONFIGURE_OPTS) \
$$(HOST_PKG_CARGO_ENV) \
@@ -269,7 +269,7 @@ endif # ifndef $(2)_BUILD_CMDS
#
ifndef $(2)_INSTALL_TARGET_CMDS
define $(2)_INSTALL_TARGET_CMDS
- cd $$($$(PKG)_SRCDIR) && \
+ cd $$($$(PKG)_SRCSUBDIR) && \
$$(TARGET_MAKE_ENV) \
$$(TARGET_CONFIGURE_OPTS) \
$$(PKG_CARGO_ENV) \
@@ -289,7 +289,7 @@ endif
ifndef $(2)_INSTALL_CMDS
define $(2)_INSTALL_CMDS
- cd $$($$(PKG)_SRCDIR) && \
+ cd $$($$(PKG)_SRCSUBDIR) && \
$$(HOST_MAKE_ENV) \
$$(HOST_CONFIGURE_OPTS) \
$$(HOST_PKG_CARGO_ENV) \
diff --git a/package/pkg-hare.mk b/package/pkg-hare.mk
index 15dc769311a8..a263b4d42ef3 100644
--- a/package/pkg-hare.mk
+++ b/package/pkg-hare.mk
@@ -48,10 +48,10 @@ ifndef $(2)_BUILD_CMDS
# https://harelang.org/documentation/usage/project-structure.html#makefiles
# but in real world, the target "all" is not always the default one
define $(2)_BUILD_CMDS
- if grep "^all:" $$($(2)_SRCDIR)Makefile > /dev/null; then \
+ if grep "^all:" $$($(2)_SRCSUBDIR)Makefile > /dev/null; then \
target=all ; \
fi ; \
- $(MAKE) -C $$($(2)_SRCDIR) HARE="$$(HARE_RUN_CMD)" HAREFLAGS="$$(HARE_ARCH_OPT) $$(HARE_LIBDIR_OPT)" $${target}
+ $(MAKE) -C $$($(2)_SRCSUBDIR) HARE="$$(HARE_RUN_CMD)" HAREFLAGS="$$(HARE_ARCH_OPT) $$(HARE_LIBDIR_OPT)" $${target}
endef
endif
@@ -61,7 +61,7 @@ endif
#
ifndef $(2)_INSTALL_STAGING_CMDS
define $(2)_INSTALL_STAGING_CMDS
- $(MAKE) -C $$($(2)_SRCDIR) PREFIX=/usr DESTDIR="$$(STAGING_DIR)" install
+ $(MAKE) -C $$($(2)_SRCSUBDIR) PREFIX=/usr DESTDIR="$$(STAGING_DIR)" install
endef
endif
@@ -71,7 +71,7 @@ endif
#
ifndef $(2)_INSTALL_TARGET_CMDS
define $(2)_INSTALL_TARGET_CMDS
- $(MAKE) -C $$($(2)_SRCDIR) PREFIX=/usr DESTDIR="$$(TARGET_DIR)" install
+ $(MAKE) -C $$($(2)_SRCSUBDIR) PREFIX=/usr DESTDIR="$$(TARGET_DIR)" install
endef
endif
diff --git a/package/pkg-luarocks.mk b/package/pkg-luarocks.mk
index abcd525fcf8a..9c12ed627b60 100644
--- a/package/pkg-luarocks.mk
+++ b/package/pkg-luarocks.mk
@@ -108,7 +108,7 @@ endif
#
ifndef $(2)_INSTALL_TARGET_CMDS
define $(2)_INSTALL_TARGET_CMDS
- cd $$($(2)_SRCDIR) && \
+ cd $$($(2)_SRCSUBDIR) && \
LUAROCKS_CONFIG=$$(LUAROCKS_CONFIG_FILE) \
$$(LUAROCKS_RUN_CMD) make --keep --deps-mode none \
--tree "$$(TARGET_DIR)/usr" \
@@ -125,7 +125,7 @@ endif
ifndef $(2)_INSTALL_CMDS
define $(2)_INSTALL_CMDS
- cd $$($(2)_SRCDIR) && \
+ cd $$($(2)_SRCSUBDIR) && \
LUAROCKS_CONFIG=$$(HOST_LUAROCKS_CONFIG_FILE) \
$$(LUAROCKS_RUN_CMD) make --keep --deps-mode none \
DEPS_DIR="$$(HOST_DIR)" \
diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index f2efbae2eb72..350f597b7018 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -147,12 +147,12 @@ $(2)_CXXFLAGS ?= $$(TARGET_CXXFLAGS)
#
#
define $(2)_CONFIGURE_CMDS
- rm -rf $$($$(PKG)_SRCDIR)/buildroot-build
- mkdir -p $$($$(PKG)_SRCDIR)/buildroot-build
+ rm -rf $$($$(PKG)_SRCSUBDIR)/buildroot-build
+ mkdir -p $$($$(PKG)_SRCSUBDIR)/buildroot-build
sed -e "/^\[binaries\]$$$$/s:$$$$:$$(foreach x,$$($(2)_MESON_EXTRA_BINARIES),\n$$(x)):" \
-e "/^\[properties\]$$$$/s:$$$$:$$(foreach x,$$($(2)_MESON_EXTRA_PROPERTIES),\n$$(x)):" \
$$(call PKG_MESON_CROSSCONFIG_SED,$(2)_CFLAGS,$(2)_CXXFLAGS,$(2)_LDFLAGS,$(2)_FCFLAGS) \
- > $$($$(PKG)_SRCDIR)/buildroot-build/cross-compilation.conf
+ > $$($$(PKG)_SRCSUBDIR)/buildroot-build/cross-compilation.conf
PATH=$$(BR_PATH) \
CC_FOR_BUILD="$$(HOSTCC)" \
CXX_FOR_BUILD="$$(HOSTCXX)" \
@@ -162,21 +162,21 @@ define $(2)_CONFIGURE_CMDS
--libdir=lib \
--default-library=$(PKG_MESON_DEFAULT_LIBRARY) \
--buildtype=$(if $(BR2_ENABLE_RUNTIME_DEBUG),debug,release) \
- --cross-file=$$($$(PKG)_SRCDIR)/buildroot-build/cross-compilation.conf \
+ --cross-file=$$($$(PKG)_SRCSUBDIR)/buildroot-build/cross-compilation.conf \
-Db_pie=false \
-Db_staticpic=$(if $(BR2_m68k_cf),false,true) \
-Dstrip=false \
-Dbuild.pkg_config_path=$$(HOST_DIR)/lib/pkgconfig \
-Dbuild.cmake_prefix_path=$$(HOST_DIR)/lib/cmake \
$$($$(PKG)_CONF_OPTS) \
- $$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/buildroot-build
+ $$($$(PKG)_SRCSUBDIR) $$($$(PKG)_SRCSUBDIR)/buildroot-build
endef
else
# Configure package for host
define $(2)_CONFIGURE_CMDS
- rm -rf $$($$(PKG)_SRCDIR)/buildroot-build
- mkdir -p $$($$(PKG)_SRCDIR)/buildroot-build
+ rm -rf $$($$(PKG)_SRCSUBDIR)/buildroot-build
+ mkdir -p $$($$(PKG)_SRCSUBDIR)/buildroot-build
$$(HOST_CONFIGURE_OPTS) \
$$($$(PKG)_CONF_ENV) $$(MESON) setup \
--prefix=$$(HOST_DIR) \
@@ -188,7 +188,7 @@ define $(2)_CONFIGURE_CMDS
--wrap-mode=nodownload \
-Dstrip=true \
$$($$(PKG)_CONF_OPTS) \
- $$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/buildroot-build
+ $$($$(PKG)_SRCSUBDIR) $$($$(PKG)_SRCSUBDIR)/buildroot-build
endef
endif
endif
@@ -203,12 +203,12 @@ ifndef $(2)_BUILD_CMDS
ifeq ($(4),target)
define $(2)_BUILD_CMDS
$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
- $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/buildroot-build
+ $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCSUBDIR)/buildroot-build
endef
else
define $(2)_BUILD_CMDS
$$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
- $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/buildroot-build
+ $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCSUBDIR)/buildroot-build
endef
endif
endif
@@ -220,7 +220,7 @@ endif
ifndef $(2)_INSTALL_CMDS
define $(2)_INSTALL_CMDS
$$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
- $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/buildroot-build install
+ $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCSUBDIR)/buildroot-build install
endef
endif
@@ -231,7 +231,7 @@ endif
ifndef $(2)_INSTALL_STAGING_CMDS
define $(2)_INSTALL_STAGING_CMDS
$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(STAGING_DIR) \
- $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/buildroot-build install
+ $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCSUBDIR)/buildroot-build install
endef
endif
@@ -242,7 +242,7 @@ endif
ifndef $(2)_INSTALL_TARGET_CMDS
define $(2)_INSTALL_TARGET_CMDS
$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(TARGET_DIR) \
- $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/buildroot-build install
+ $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCSUBDIR)/buildroot-build install
endef
endif
diff --git a/package/pkg-perl.mk b/package/pkg-perl.mk
index 1ecf31eff9ca..1fbfb00e3796 100644
--- a/package/pkg-perl.mk
+++ b/package/pkg-perl.mk
@@ -67,7 +67,7 @@ ifeq ($(4),target)
# Configure package for target
define $(2)_CONFIGURE_CMDS
- cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
+ cd $$($$(PKG)_SRCSUBDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
$$($(2)_CONF_ENV) \
PERL_MM_USE_DEFAULT=1 \
$$(PERL_RUN) Build.PL \
@@ -118,7 +118,7 @@ else
# Configure package for host
define $(2)_CONFIGURE_CMDS
- cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
+ cd $$($$(PKG)_SRCSUBDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
$$($(2)_CONF_ENV) \
PERL_MM_USE_DEFAULT=1 \
$$(PERL_RUN) Build.PL \
@@ -144,7 +144,7 @@ ifeq ($(4),target)
# Build package for target
define $(2)_BUILD_CMDS
- cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
+ cd $$($$(PKG)_SRCSUBDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
$$(PERL_RUN) Build $$($(2)_BUILD_OPTS) build; \
else \
$$(MAKE1) \
@@ -156,7 +156,7 @@ else
# Build package for host
define $(2)_BUILD_CMDS
- cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
+ cd $$($$(PKG)_SRCSUBDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
$$(PERL_RUN) Build $$($(2)_BUILD_OPTS) build; \
else \
$$(MAKE1) $$($(2)_BUILD_OPTS) pure_all; \
@@ -171,7 +171,7 @@ endif
#
ifndef $(2)_INSTALL_CMDS
define $(2)_INSTALL_CMDS
- cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
+ cd $$($$(PKG)_SRCSUBDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
$$(PERL_RUN) Build $$($(2)_INSTALL_TARGET_OPTS) install; \
else \
$$(MAKE1) $$($(2)_INSTALL_TARGET_OPTS) pure_install; \
@@ -185,7 +185,7 @@ endif
#
ifndef $(2)_INSTALL_TARGET_CMDS
define $(2)_INSTALL_TARGET_CMDS
- cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
+ cd $$($$(PKG)_SRCSUBDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
$$(PERL_RUN) Build $$($(2)_INSTALL_TARGET_OPTS) install; \
else \
$$(MAKE1) $$($(2)_INSTALL_TARGET_OPTS) pure_install; \
diff --git a/package/pkg-waf.mk b/package/pkg-waf.mk
index 0529bb6ddaf2..c41d7314a132 100644
--- a/package/pkg-waf.mk
+++ b/package/pkg-waf.mk
@@ -65,7 +65,7 @@ endif
#
ifndef $(2)_CONFIGURE_CMDS
define $(2)_CONFIGURE_CMDS
- cd $$($$(PKG)_SRCDIR) && \
+ cd $$($$(PKG)_SRCSUBDIR) && \
$$(TARGET_CONFIGURE_OPTS) \
$$($(2)_CONF_ENV) \
$$(HOST_DIR)/bin/python3 $$($(2)_WAF) configure \
@@ -82,7 +82,7 @@ endif
#
ifndef $(2)_BUILD_CMDS
define $(2)_BUILD_CMDS
- cd $$($$(PKG)_SRCDIR) && \
+ cd $$($$(PKG)_SRCSUBDIR) && \
$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$(HOST_DIR)/bin/python3 $$($(2)_WAF) \
build $$(WAF_OPTS) $$($(2)_BUILD_OPTS) \
$$($(2)_WAF_OPTS)
@@ -95,7 +95,7 @@ endif
#
ifndef $(2)_INSTALL_STAGING_CMDS
define $(2)_INSTALL_STAGING_CMDS
- cd $$($$(PKG)_SRCDIR) && \
+ cd $$($$(PKG)_SRCSUBDIR) && \
$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$(HOST_DIR)/bin/python3 $$($(2)_WAF) \
install --destdir=$$(STAGING_DIR) \
$$($(2)_INSTALL_STAGING_OPTS) \
@@ -109,7 +109,7 @@ endif
#
ifndef $(2)_INSTALL_TARGET_CMDS
define $(2)_INSTALL_TARGET_CMDS
- cd $$($$(PKG)_SRCDIR) && \
+ cd $$($$(PKG)_SRCSUBDIR) && \
$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$(HOST_DIR)/bin/python3 $$($(2)_WAF) \
install --destdir=$$(TARGET_DIR) \
$$($(2)_INSTALL_TARGET_OPTS) \
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* [Buildroot] [PATCH 09/23] linux: build out of tree when LINUX_OVERRIDE_SRCDIR is set
2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 08/23] package: use <pkg>_SRCSUBDIR where <pkg>_SRCDIR used to include _SUBDIR Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 10/23] packages: sync host and target patch hooks Florian Fainelli via buildroot
` (13 subsequent siblings)
15 siblings, 0 replies; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Eric Le Bihan, Gary Bisson, Jérôme Pouiller,
Florian Fainelli, Bernd Kuhls, Thomas Perale, Maxime Chevallier,
Refik Tuzakli, Francois Perrad, Thomas Petazzoni,
Arnout Vandecappelle, Petr Vorel, Spenser Gilliland,
Giulio Benetti, Pascal de Bruijn, Luca Ceresoli, Romain Naour,
Mahyar Koshkouei
Introduce <pkg>_SUPPORTS_OUT_OF_TREE. For a package that sets it and
has <pkg>_OVERRIDE_SRCDIR defined:
- <pkg>_SRCDIR is the overridden directory, used in place: nothing is
rsynced into $(BUILD_DIR), only the pre/post rsync hooks still run;
- the source-related stamp files (rsynced, patched, ...) live in the
build directory so that nothing is created in the user's tree;
- kconfig packages start from the source directory with O=<builddir>,
which makes kbuild generate its wrapper Makefile in the build
directory, so that all the existing -C $(LINUX_DIR) invocations keep
working unmodified.
Enable it for the Linux kernel. The source tree must be clean (no
in-tree .config, include/config, arch/*/include/generated).
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
linux/linux.mk | 4 ++++
package/pkg-generic.mk | 30 ++++++++++++++++++++++--------
package/pkg-kconfig.mk | 6 +++++-
3 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/linux/linux.mk b/linux/linux.mk
index a90e09afe906..ffec32154222 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -6,6 +6,10 @@
LINUX_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
LINUX_LICENSE = GPL-2.0
+
+# When LINUX_OVERRIDE_SRCDIR is set, build out of tree: no rsync of the
+# sources, the kernel is built in $(BUILD_DIR)/linux-custom with O=.
+LINUX_SUPPORTS_OUT_OF_TREE = YES
LINUX_LICENSE_FILES = $(call qstrip,$(BR2_LINUX_KERNEL_LICENSE_FILES))
LINUX_CPE_ID_VENDOR = linux
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 138fe9ccef4f..c8f532e1c3e6 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -221,11 +221,11 @@ $(SRC_DIR)/%/.stamp_extracted:
# used.
$(SRC_DIR)/%/.stamp_rsynced:
@$(call step_start,rsync)
- @$(call MESSAGE,"Syncing from source dir $(SRCDIR)")
+ @$(call MESSAGE,"$(if $($(PKG)_OUT_OF_TREE),Using out-of-tree source dir,Syncing from source dir) $(SRCDIR)")
@mkdir -p $(@D)
$(foreach hook,$($(PKG)_PRE_RSYNC_HOOKS),$(call $(hook))$(sep))
@test -d $(SRCDIR) || (echo "ERROR: $(SRCDIR) does not exist" ; exit 1)
- rsync -au --chmod=u=rwX,go=rX $($(PKG)_OVERRIDE_SRCDIR_RSYNC_EXCLUSIONS) $(RSYNC_VCS_EXCLUSIONS) $(call qstrip,$(SRCDIR))/ $(@D)
+ $(if $($(PKG)_OUT_OF_TREE),,rsync -au --chmod=u=rwX,go=rX $($(PKG)_OVERRIDE_SRCDIR_RSYNC_EXCLUSIONS) $(RSYNC_VCS_EXCLUSIONS) $(call qstrip,$(SRCDIR))/ $(@D))
$(foreach hook,$($(PKG)_POST_RSYNC_HOOKS),$(call $(hook))$(sep))
@$(call step_end,rsync)
$(Q)touch $@
@@ -559,13 +559,27 @@ ifndef $(2)_STRIP_COMPONENTS
endif
$(2)_SRCDIR = $$($(2)_DIR)
-$(2)_BUILDDIR = $$($(2)_DIR)
+$(2)_BUILDDIR ?= $$($(2)_DIR)
$(2)_SRCSUBDIR = $$($(2)_SRCDIR)/$$($(2)_SUBDIR)
ifneq ($$($(2)_OVERRIDE_SRCDIR),)
$(2)_VERSION = custom
endif
+# Packages that set <pkg>_SUPPORTS_OUT_OF_TREE = YES can be built out of
+# tree when their source directory is overridden: the sources are used
+# where they are (no rsync), and only the build directory lives in
+# $(BUILD_DIR). The source-related stamp files must then not be created
+# in the (user-owned) source directory, so they live in the build directory.
+$(2)_STAMP_SRCDIR = $$($(2)_SRCDIR)
+ifneq ($$($(2)_OVERRIDE_SRCDIR),)
+ifeq ($$($(3)_SUPPORTS_OUT_OF_TREE),YES)
+$(2)_OUT_OF_TREE = YES
+$(2)_SRCDIR = $$(abspath $$(call qstrip,$$($(2)_OVERRIDE_SRCDIR)))
+$(2)_STAMP_SRCDIR = $$($(2)_BUILDDIR)
+endif
+endif
+
ifndef $(2)_SOURCE
ifdef $(3)_SOURCE
$(2)_SOURCE = $$($(3)_SOURCE)
@@ -844,11 +858,11 @@ $(2)_TARGET_INSTALL_IMAGES = $$($(2)_BUILDDIR)/.stamp_images_installed
$(2)_TARGET_INSTALL_HOST = $$($(2)_BUILDDIR)/.stamp_host_installed
$(2)_TARGET_BUILD = $$($(2)_BUILDDIR)/.stamp_built
$(2)_TARGET_CONFIGURE = $$($(2)_BUILDDIR)/.stamp_configured
-$(2)_TARGET_RSYNC = $$($(2)_SRCDIR)/.stamp_rsynced
-$(2)_TARGET_PATCH = $$($(2)_SRCDIR)/.stamp_patched
-$(2)_TARGET_EXTRACT = $$($(2)_SRCDIR)/.stamp_extracted
-$(2)_TARGET_SOURCE = $$($(2)_SRCDIR)/.stamp_downloaded
-$(2)_TARGET_ACTUAL_SOURCE = $$($(2)_SRCDIR)/.stamp_actual_downloaded
+$(2)_TARGET_RSYNC = $$($(2)_STAMP_SRCDIR)/.stamp_rsynced
+$(2)_TARGET_PATCH = $$($(2)_STAMP_SRCDIR)/.stamp_patched
+$(2)_TARGET_EXTRACT = $$($(2)_STAMP_SRCDIR)/.stamp_extracted
+$(2)_TARGET_SOURCE = $$($(2)_STAMP_SRCDIR)/.stamp_downloaded
+$(2)_TARGET_ACTUAL_SOURCE = $$($(2)_STAMP_SRCDIR)/.stamp_actual_downloaded
$(2)_TARGET_DIRCLEAN = $$($(2)_BUILDDIR)/.stamp_dircleaned
# default extract command
diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
index 8a63d55be033..5e46c62c58e6 100644
--- a/package/pkg-kconfig.mk
+++ b/package/pkg-kconfig.mk
@@ -147,8 +147,12 @@ $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES): | $(1)-patch
fi; \
done
+# For an out-of-tree build, the first kconfig run is what creates the
+# wrapper Makefile in the build directory, so it must be started from
+# the source directory.
$(2)_KCONFIG_MAKE = \
- $$($(2)_MAKE_ENV) $$($(2)_MAKE) -C $$($(2)_BUILDDIR) \
+ $$($(2)_MAKE_ENV) $$($(2)_MAKE) \
+ $$(if $$($(2)_OUT_OF_TREE),-C $$($(2)_SRCDIR) O=$$($(2)_BUILDDIR),-C $$($(2)_BUILDDIR)) \
$$(PKG_KCONFIG_COMMON_OPTS) $$($(2)_KCONFIG_OPTS)
# The specified source configuration file and any additional configuration file
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* [Buildroot] [PATCH 10/23] packages: sync host and target patch hooks
2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 08/23] package: use <pkg>_SRCSUBDIR where <pkg>_SRCDIR used to include _SUBDIR Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 09/23] linux: build out of tree when LINUX_OVERRIDE_SRCDIR is set Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 11/23] omniorb: avoid target-only patch hook Florian Fainelli via buildroot
` (12 subsequent siblings)
15 siblings, 0 replies; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Thomas Petazzoni, Eric Le Bihan, Jérôme Pouiller,
Florian Fainelli, Gary Bisson, Romain Naour, Bernd Kuhls,
Thomas Perale, Maxime Chevallier, Refik Tuzakli, Francois Perrad,
Thomas Petazzoni, Arnout Vandecappelle, Petr Vorel,
Spenser Gilliland, Giulio Benetti, Pascal de Bruijn,
Luca Ceresoli, Yann E. MORIN, Mahyar Koshkouei
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
In preparation for the introduction of out-of-tree package build, it
is important that we don't do different things in the patch hooks for
the target and host variant of a given package, because the source
tree will be shared between the target and host builds.
For the gawk, icu, python and python3 packages touched by this patch,
there is no problem in running the target-only post-patch hook that
already exists to the host variant, so we simply do that.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
(cherry picked from commit 7d6a8f1ace39bbc96a1deab5c5c41d6c16ebf36a)
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
package/icu/icu.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/package/icu/icu.mk b/package/icu/icu.mk
index 9b97011f5587..d17b610aeea4 100644
--- a/package/icu/icu.mk
+++ b/package/icu/icu.mk
@@ -67,6 +67,7 @@ define ICU_COPY_CUSTOM_DATA
cp $(ICU_CUSTOM_DATA_PATH) $(@D)/source/data/in/
endef
ICU_POST_PATCH_HOOKS += ICU_COPY_CUSTOM_DATA
+HOST_ICU_POST_PATCH_HOOKS += ICU_COPY_CUSTOM_DATA
endif
define ICU_REMOVE_DEV_FILES
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* [Buildroot] [PATCH 11/23] omniorb: avoid target-only patch hook
2026-10-23 21:51 ` Florian Fainelli via buildroot
` (2 preceding siblings ...)
2026-10-23 21:51 ` [Buildroot] [PATCH 10/23] packages: sync host and target patch hooks Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 12/23] lua: rework post-patch hook usage Florian Fainelli via buildroot
` (11 subsequent siblings)
15 siblings, 0 replies; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Gary Bisson, Thomas Petazzoni, Petr Vorel, Spenser Gilliland,
Florian Fainelli, Maxime Chevallier, Francois Perrad,
Arnout Vandecappelle, Luca Ceresoli, Thomas Perale, Eric Le Bihan,
Mahyar Koshkouei, Yann E. MORIN, Matt Weber, Giulio Benetti,
Pascal de Bruijn, Thomas Petazzoni, Jérôme Pouiller,
Bernd Kuhls, Refik Tuzakli, Romain Naour
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
In preparation for the introduction of out-of-tree package build, it
is important that we don't do different things in the patch hooks for
the target and host variant of a given package, because the source
tree will be shared between the target and host builds.
The omniorb package was doing exactly this: when
BR2_PACKAGE_OMNIORB_WITH_APPS was enabled, it was patching the source
code, but only for the target package.
We replace this solution by adding a patch to OmniORB, which allows to
conditionally enable or disabled the compilation of the apps and
services, which is then used by BR2_PACKAGE_OMNIORB_WITH_APPS in a
post configure hook.
Cc: Matt Weber <mlweber1@rockwellcollins.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[yann.morin.1998@free.fr: renumber patch]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
(cherry picked from commit c5fe01e3c525babdc6ad1939fb3f98eae91f7c9f)
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
.../omniorb/0002-optional-appl-services.patch | 29 +++++++++++++++++++
package/omniorb/omniorb.mk | 26 ++++++++---------
2 files changed, 42 insertions(+), 13 deletions(-)
create mode 100644 package/omniorb/0002-optional-appl-services.patch
diff --git a/package/omniorb/0002-optional-appl-services.patch b/package/omniorb/0002-optional-appl-services.patch
new file mode 100644
index 000000000000..9e3177465e27
--- /dev/null
+++ b/package/omniorb/0002-optional-appl-services.patch
@@ -0,0 +1,29 @@
+Add support for EmbeddedSystemWithApps
+
+The EmbeddedSystem option allows to disable building a lot of things
+from omniorb: tools, apps, services, python bindings, and more.
+
+However, there are situations where we want to disable all of these
+things, except apps and services. Therefore, as a quick workaround,
+this patch adds support for a EmbeddedSystemWithApps, which when
+defined, will build apps and services even if EmbeddedSystem is
+defined.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Upstream: N/A (Buildroot specific)
+
+Index: b/src/dir.mk
+===================================================================
+--- a/src/dir.mk
++++ b/src/dir.mk
+@@ -16,6 +16,10 @@
+ SUBDIRS += appl services
+ endif
+
++ifdef EmbeddedSystemWithApps
++SUBDIRS += appl services
++endif
++
+ all::
+ @echo
+ @echo 'No "all" rule here. If you want to build and export everything'
diff --git a/package/omniorb/omniorb.mk b/package/omniorb/omniorb.mk
index b61c7c3537bc..866d8d76b085 100644
--- a/package/omniorb/omniorb.mk
+++ b/package/omniorb/omniorb.mk
@@ -34,19 +34,6 @@ ifeq ($(BR2_PACKAGE_ZLIB),y)
OMNIORB_DEPENDENCIES += zlib
endif
-# The EmbeddedSystem define (set below in OMNIORB_ADJUST_TOOLDIR)
-# enables building of just the lib and disables building of
-# tools/apps/services. In some cases the apps/services are still
-# required. The tools however are host related and should never
-# be required on target.
-define OMNIORB_ENABLE_EXTRA_APPS
- $(SED) 's:SUBDIRS += lib:SUBDIRS += lib appl services:g' $(@D)/src/dir.mk
-endef
-
-ifeq ($(BR2_PACKAGE_OMNIORB_WITH_APPS),y)
-OMNIORB_POST_PATCH_HOOKS += OMNIORB_ENABLE_EXTRA_APPS
-endif
-
ifeq ($(BR2_STATIC_LIBS),y)
define OMNIORB_DISABLE_SHARED
echo "BuildSharedLibrary =" >> $(@D)/mk/beforeauto.mk
@@ -67,5 +54,18 @@ define OMNIORB_ADJUST_TOOLDIR
endef
OMNIORB_POST_CONFIGURE_HOOKS += OMNIORB_ADJUST_TOOLDIR
+ifeq ($(BR2_PACKAGE_OMNIORB_WITH_APPS),y)
+# The EmbeddedSystem define (set above in OMNIORB_ADJUST_TOOLDIR)
+# enables building of just the lib and disables building of
+# tools/apps/services. In some cases the apps/services are still
+# required. The tools however are host related and should never
+# be required on target.
+define OMNIORB_ENABLE_EXTRA_APPS
+ echo "EmbeddedSystemWithApps=1" >> $(@D)/mk/beforeauto.mk
+endef
+
+OMNIORB_POST_CONFIGURE_HOOKS += OMNIORB_ENABLE_EXTRA_APPS
+endif
+
$(eval $(autotools-package))
$(eval $(host-autotools-package))
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* [Buildroot] [PATCH 12/23] lua: rework post-patch hook usage
2026-10-23 21:51 ` Florian Fainelli via buildroot
` (3 preceding siblings ...)
2026-10-23 21:51 ` [Buildroot] [PATCH 11/23] omniorb: avoid target-only patch hook Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-24 10:46 ` François PERRAD
2026-10-23 21:51 ` [Buildroot] [PATCH 13/23] infra: host packages inherit the target extra downloads Florian Fainelli via buildroot
` (10 subsequent siblings)
15 siblings, 1 reply; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Gary Bisson, Thomas Petazzoni, Petr Vorel, Spenser Gilliland,
Francois Perrad, Florian Fainelli, Maxime Chevallier,
Francois Perrad, Arnout Vandecappelle, Luca Ceresoli,
Thomas Perale, Eric Le Bihan, Mahyar Koshkouei, Yann E. MORIN,
Romain Naour, Pascal de Bruijn, Thomas Petazzoni,
Jérôme Pouiller, Bernd Kuhls, Refik Tuzakli,
Giulio Benetti
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
WIP: YEM: try to see if we can make that a post-configure hook
In preparation for the introduction of out-of-tree package build, it
is important that we don't do different things in the patch hooks for
the target and host variant of a given package, because the source
tree will be shared between the target and host builds.
For lua, the post patch hook was modifying luaconf.h before the build
to get a 32 bits Lua build. However, passing just -DLUA_32BITS like we
do for other Lua compile time options is not sufficient since
LUA_32BITS should also be defined in the installed luaconf.h so that
other packages linking against lua get this defined as well. So, this
patch changes the post-patch hook to passing -DLUA_32BITS in
LUA_CFLAGS *and* changing the installed luaconf.h in a
post-install-staging hook.
Cc: Francois Perrad <fperrad@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
(cherry picked from commit 827ed461ba2b00acfebcbd01e53d93a148594833)
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
package/lua/lua.mk | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/package/lua/lua.mk b/package/lua/lua.mk
index 6dbdc950021b..92910f8fe746 100644
--- a/package/lua/lua.mk
+++ b/package/lua/lua.mk
@@ -66,11 +66,16 @@ endif
endif
ifeq ($(BR2_PACKAGE_LUA_32BITS),y)
+# We adjust the CFLAGS for the build of Lua itself, and then the
+# installed luaconf.h so that package using Lua also see LUA_32BITS
+# defined.
+LUA_CFLAGS += -DLUA_32BITS
define LUA_32BITS_LUACONF
- $(SED) 's/\/\* #define LUA_32BITS \*\//#define LUA_32BITS/' $(@D)/src/luaconf.h
+ $(SED) 's/\/\* #define LUA_32BITS \*\//#define LUA_32BITS/' \
+ $(STAGING_DIR)/usr/include/luaconf.h
endef
-LUA_POST_PATCH_HOOKS += LUA_32BITS_LUACONF
+LUA_POST_INSTALL_STAGING_HOOKS += LUA_32BITS_LUACONF
endif
define HOST_LUA_LUACONF
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* Re: [Buildroot] [PATCH 12/23] lua: rework post-patch hook usage
2026-10-23 21:51 ` [Buildroot] [PATCH 12/23] lua: rework post-patch hook usage Florian Fainelli via buildroot
@ 2026-10-24 10:46 ` François PERRAD
2026-10-27 16:43 ` Florian Fainelli via buildroot
0 siblings, 1 reply; 47+ messages in thread
From: François PERRAD @ 2026-10-24 10:46 UTC (permalink / raw)
To: Florian Fainelli; +Cc: buildroot
[-- Attachment #1.1: Type: text/plain, Size: 2558 bytes --]
There is another hook which alters also luaconf.h on host tree source.
It was introduced by commit "package/lua: allow host-lua to find installed
modules"
https://gitlab.com/buildroot.org/buildroot/-/commit/4be3fd6fdb73085a35e89c2c1218c1e0b1e74a79
François
Le ven. 23 oct. 2026 à 23:58, Florian Fainelli <
florian.fainelli@broadcom.com> a écrit :
> From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>
> WIP: YEM: try to see if we can make that a post-configure hook
>
> In preparation for the introduction of out-of-tree package build, it
> is important that we don't do different things in the patch hooks for
> the target and host variant of a given package, because the source
> tree will be shared between the target and host builds.
>
> For lua, the post patch hook was modifying luaconf.h before the build
> to get a 32 bits Lua build. However, passing just -DLUA_32BITS like we
> do for other Lua compile time options is not sufficient since
> LUA_32BITS should also be defined in the installed luaconf.h so that
> other packages linking against lua get this defined as well. So, this
> patch changes the post-patch hook to passing -DLUA_32BITS in
> LUA_CFLAGS *and* changing the installed luaconf.h in a
> post-install-staging hook.
>
> Cc: Francois Perrad <fperrad@gmail.com>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> (cherry picked from commit 827ed461ba2b00acfebcbd01e53d93a148594833)
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
> ---
> package/lua/lua.mk | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/package/lua/lua.mk b/package/lua/lua.mk
> index 6dbdc950021b..92910f8fe746 100644
> --- a/package/lua/lua.mk
> +++ b/package/lua/lua.mk
> @@ -66,11 +66,16 @@ endif
> endif
>
> ifeq ($(BR2_PACKAGE_LUA_32BITS),y)
> +# We adjust the CFLAGS for the build of Lua itself, and then the
> +# installed luaconf.h so that package using Lua also see LUA_32BITS
> +# defined.
> +LUA_CFLAGS += -DLUA_32BITS
> define LUA_32BITS_LUACONF
> - $(SED) 's/\/\* #define LUA_32BITS \*\//#define LUA_32BITS/'
> $(@D)/src/luaconf.h
> + $(SED) 's/\/\* #define LUA_32BITS \*\//#define LUA_32BITS/' \
> + $(STAGING_DIR)/usr/include/luaconf.h
> endef
>
> -LUA_POST_PATCH_HOOKS += LUA_32BITS_LUACONF
> +LUA_POST_INSTALL_STAGING_HOOKS += LUA_32BITS_LUACONF
> endif
>
> define HOST_LUA_LUACONF
> --
> 2.34.1
>
>
[-- Attachment #1.2: Type: text/html, Size: 3867 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 47+ messages in thread
* [Buildroot] [PATCH 13/23] infra: host packages inherit the target extra downloads
2026-10-23 21:51 ` Florian Fainelli via buildroot
` (4 preceding siblings ...)
2026-10-23 21:51 ` [Buildroot] [PATCH 12/23] lua: rework post-patch hook usage Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 14/23] package/libtool: use post-patch hooks Florian Fainelli via buildroot
` (9 subsequent siblings)
15 siblings, 0 replies; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Thomas Petazzoni, Eric Le Bihan, Jérôme Pouiller,
Florian Fainelli, Gary Bisson, Romain Naour, Bernd Kuhls,
Thomas Perale, Maxime Chevallier, Refik Tuzakli, Francois Perrad,
Thomas Petazzoni, Arnout Vandecappelle, Petr Vorel,
Spenser Gilliland, Giulio Benetti, Pascal de Bruijn,
Luca Ceresoli, Yann E. MORIN, Mahyar Koshkouei
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
Some packages need extra downloads, which are then extracted in their
source trees. Up until now, this was only used by target packages.
For example, perl will need perl-cross.
But with the upcoming merge of the host and target soruce trees, we
will also need those extra downloads for the host variants.
Update the three packages that already duplicated the host extra
downloads from the target ones.
There are three packages left that define host extra downloads, but
those packages do not have a target variant, so we can leave them
as-is.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
(cherry picked from commit 01540f0ee0cf07f77ef0dbf99d3d74f95b17f121)
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
package/android-tools/android-tools.mk | 1 -
package/binutils/binutils.mk | 1 -
package/gdb/gdb.mk | 1 -
package/pkg-generic.mk | 6 ++++++
4 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/package/android-tools/android-tools.mk b/package/android-tools/android-tools.mk
index 20e26839f977..e30fce8ab7e3 100644
--- a/package/android-tools/android-tools.mk
+++ b/package/android-tools/android-tools.mk
@@ -8,7 +8,6 @@ ANDROID_TOOLS_SITE = https://launchpad.net/ubuntu/+archive/primary/+files
ANDROID_TOOLS_VERSION = 4.2.2+git20130218
ANDROID_TOOLS_SOURCE = android-tools_$(ANDROID_TOOLS_VERSION).orig.tar.xz
ANDROID_TOOLS_EXTRA_DOWNLOADS = android-tools_$(ANDROID_TOOLS_VERSION)-3ubuntu41.debian.tar.gz
-HOST_ANDROID_TOOLS_EXTRA_DOWNLOADS = $(ANDROID_TOOLS_EXTRA_DOWNLOADS)
ANDROID_TOOLS_LICENSE = Apache-2.0
ANDROID_TOOLS_LICENSE_FILES = debian/copyright
ANDROID_TOOLS_DEPENDENCIES = host-pkgconf
diff --git a/package/binutils/binutils.mk b/package/binutils/binutils.mk
index c6a6380be99e..4b376f393bbd 100644
--- a/package/binutils/binutils.mk
+++ b/package/binutils/binutils.mk
@@ -137,7 +137,6 @@ endef
BINUTILS_POST_EXTRACT_HOOKS += BINUTILS_XTENSA_OVERLAY_EXTRACT
BINUTILS_EXTRA_DOWNLOADS += $(ARCH_XTENSA_OVERLAY_URL)
HOST_BINUTILS_POST_EXTRACT_HOOKS += BINUTILS_XTENSA_OVERLAY_EXTRACT
-HOST_BINUTILS_EXTRA_DOWNLOADS += $(ARCH_XTENSA_OVERLAY_URL)
endif
# Hardlinks between binaries in different directories cause a problem
diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index cfec0585da9d..f33cc2ed7c57 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -39,7 +39,6 @@ endef
GDB_POST_EXTRACT_HOOKS += GDB_XTENSA_OVERLAY_EXTRACT
GDB_EXTRA_DOWNLOADS += $(ARCH_XTENSA_OVERLAY_URL)
HOST_GDB_POST_EXTRACT_HOOKS += GDB_XTENSA_OVERLAY_EXTRACT
-HOST_GDB_EXTRA_DOWNLOADS += $(ARCH_XTENSA_OVERLAY_URL)
endif
ifeq ($(GDB_FROM_GIT),y)
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index c8f532e1c3e6..066396332099 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -602,6 +602,12 @@ ifndef $(2)_PATCH
endif
endif
+ifndef $(2)_EXTRA_DOWNLOADS
+ ifdef $(3)_EXTRA_DOWNLOADS
+ $(2)_EXTRA_DOWNLOADS = $$($(3)_EXTRA_DOWNLOADS)
+ endif
+endif
+
$(2)_MAIN_DOWNLOAD = \
$$(if $$($(2)_SOURCE),$$($(2)_SITE_METHOD)+$$($(2)_SITE)/$$($(2)_SOURCE))
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* [Buildroot] [PATCH 14/23] package/libtool: use post-patch hooks
2026-10-23 21:51 ` Florian Fainelli via buildroot
` (5 preceding siblings ...)
2026-10-23 21:51 ` [Buildroot] [PATCH 13/23] infra: host packages inherit the target extra downloads Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 15/23] package/libtool: also apply libtool-patch to host libtool Florian Fainelli via buildroot
` (8 subsequent siblings)
15 siblings, 0 replies; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Thomas Petazzoni, Eric Le Bihan, Jérôme Pouiller,
Florian Fainelli, Gary Bisson, Romain Naour, Bernd Kuhls,
Thomas Perale, Maxime Chevallier, Refik Tuzakli, Francois Perrad,
Thomas Petazzoni, Arnout Vandecappelle, Petr Vorel,
Spenser Gilliland, Giulio Benetti, Pascal de Bruijn,
Luca Ceresoli, Yann E. MORIN, Mahyar Koshkouei
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Run the autoreconf-avoidance tweaks from a post-patch hook, rather than
a pre-configure one, both for the target and host variants.
This will ease migrating to a shared host/target source tree.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[yann.morin.1998@free.fr: remove FIXME, actually do the migration]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
The hooks are still not the same, because we do not yet apply the
libtool patch on the host variant. This will be handled in a followup
patch
(cherry picked from commit b49cb508257ff7f075b4409101d98a589eb8d446)
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
package/libtool/libtool.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package/libtool/libtool.mk b/package/libtool/libtool.mk
index ecadc3e696f4..45441e1e4676 100644
--- a/package/libtool/libtool.mk
+++ b/package/libtool/libtool.mk
@@ -45,8 +45,8 @@ define LIBTOOL_AVOID_AUTORECONF_HOOK
find $(@D) -name configure -exec touch '{}' \;
find $(@D) -name Makefile.in -exec touch '{}' \;
endef
-LIBTOOL_PRE_CONFIGURE_HOOKS += LIBTOOL_AVOID_AUTORECONF_HOOK
-HOST_LIBTOOL_PRE_CONFIGURE_HOOKS += LIBTOOL_AVOID_AUTORECONF_HOOK
+LIBTOOL_POST_PATCH_HOOKS += LIBTOOL_AVOID_AUTORECONF_HOOK
+HOST_LIBTOOL_POST_PATCH_HOOKS += LIBTOOL_AVOID_AUTORECONF_HOOK
$(eval $(autotools-package))
$(eval $(host-autotools-package))
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* [Buildroot] [PATCH 15/23] package/libtool: also apply libtool-patch to host libtool
2026-10-23 21:51 ` Florian Fainelli via buildroot
` (6 preceding siblings ...)
2026-10-23 21:51 ` [Buildroot] [PATCH 14/23] package/libtool: use post-patch hooks Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 16/23] package/{ffmpeg, libvpx}: use $(@D) instead of $(pkg_SRCDIR) when possible Florian Fainelli via buildroot
` (7 subsequent siblings)
15 siblings, 0 replies; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Thomas Petazzoni, Eric Le Bihan, Jérôme Pouiller,
Florian Fainelli, Gary Bisson, Romain Naour, Bernd Kuhls,
Thomas Perale, Maxime Chevallier, Refik Tuzakli, Francois Perrad,
Thomas Petazzoni, Arnout Vandecappelle, Petr Vorel,
Spenser Gilliland, Giulio Benetti, Pascal de Bruijn,
Luca Ceresoli, Yann E. MORIN, Mahyar Koshkouei
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
Currently, we avoid applying our libtool patch to the host variant of
libtool. This is mostly historical.
However, this means that the host and target sources are not the same,
and this is an hindrance to out-of-tree build.
It turns out that we in fact can apply our hook. We just need to do like
for the target variant to avoid building the documentation.
However, that has a direct impact on the autotools package infra. When a
package is using libtool, and gets autoreconf-ed, the libtool-installed
ltmain.sh is copied to the package source tree. This lt-main.sh is what
our LIBTOOL_PATCH_HOOK hook would patch. But that lt-main.sh file is the
one that was already patched in, and installed by, the host-libtool
package.
So, we no longer need to apply the libtool patch to packages that get
autoreconf-ed, as they will automatically get the correct, patched
version now.
Note that for packages that we do not autoreconf, we still need to
use the libtool patch, as is currently done, to patch the lt-main.sh in
the package source
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
(cherry picked from commit 70fa1fb72eef8325263df640f7781710875f6ad3)
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
package/libtool/libtool.mk | 1 -
package/pkg-autotools.mk | 4 ----
2 files changed, 5 deletions(-)
diff --git a/package/libtool/libtool.mk b/package/libtool/libtool.mk
index 45441e1e4676..98ca31d549a4 100644
--- a/package/libtool/libtool.mk
+++ b/package/libtool/libtool.mk
@@ -26,7 +26,6 @@ HOST_LIBTOOL_LICENSE = GPL-2.0+ (libtool), LGPL-2.1+ (libltdl)
HOST_LIBTOOL_LICENSE_FILES = COPYING $(LIBTOOL_SUBDIR)/COPYING.LIB
HOST_LIBTOOL_CONF_ENV = HELP2MAN=true MAKEINFO=true
-HOST_LIBTOOL_LIBTOOL_PATCH = NO
# We have a patch that affects libtool.m4, which triggers an autoreconf
# in the build step. Normally we would set AUTORECONF = YES, but this
diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
index 58b63317cb60..89894b9b6cfc 100644
--- a/package/pkg-autotools.mk
+++ b/package/pkg-autotools.mk
@@ -243,10 +243,6 @@ else
$(2)_AUTORECONF_ENV += AUTOPOINT=/bin/true
endif
$(2)_PRE_CONFIGURE_HOOKS += AUTORECONF_HOOK
-# default values are not evaluated yet, so don't rely on this defaulting to YES
-ifneq ($$($(2)_LIBTOOL_PATCH),NO)
-$(2)_PRE_CONFIGURE_HOOKS += LIBTOOL_PATCH_HOOK
-endif
$(2)_DEPENDENCIES += host-automake host-autoconf host-libtool
else # ! AUTORECONF = YES
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* [Buildroot] [PATCH 16/23] package/{ffmpeg, libvpx}: use $(@D) instead of $(pkg_SRCDIR) when possible
2026-10-23 21:51 ` Florian Fainelli via buildroot
` (7 preceding siblings ...)
2026-10-23 21:51 ` [Buildroot] [PATCH 15/23] package/libtool: also apply libtool-patch to host libtool Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 17/23] package/perl: apply the perl-cross even for the host variant Florian Fainelli via buildroot
` (6 subsequent siblings)
15 siblings, 0 replies; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Thomas Petazzoni, Eric Le Bihan, Jérôme Pouiller,
Florian Fainelli, Gary Bisson, Romain Naour, Bernd Kuhls,
Thomas Perale, Maxime Chevallier, Refik Tuzakli, Francois Perrad,
Thomas Petazzoni, Arnout Vandecappelle, Petr Vorel,
Spenser Gilliland, Giulio Benetti, Pascal de Bruijn,
Luca Ceresoli, Yann E. MORIN, Mahyar Koshkouei
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
$(@D) points to the package build directory, i.e
$(O)/build/<name>-<version>/. $(pkg_SRCDIR) is identical, except when
$(pkg_SUBDIR) is used, in which case $(pkg_SRCDIR) is
$(O)/build/<name>-<version>/$(pkg_SUBDIR).
When possible use $(@D), like we're doing in all packages. This will
facilitate future changes in the package infrastructure.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
(cherry picked from commit b1791fe7c10bc312328926b45108553dbc674254)
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
package/ffmpeg/ffmpeg.mk | 2 +-
package/libvpx/libvpx.mk | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/package/ffmpeg/ffmpeg.mk b/package/ffmpeg/ffmpeg.mk
index 4ce129132d9e..a6815c15b6d1 100644
--- a/package/ffmpeg/ffmpeg.mk
+++ b/package/ffmpeg/ffmpeg.mk
@@ -604,7 +604,7 @@ FFMPEG_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_FFMPEG_EXTRACONF))
# Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
define FFMPEG_CONFIGURE_CMDS
- (cd $(FFMPEG_SRCDIR) && rm -rf config.cache && \
+ (cd $(@D) && rm -rf config.cache && \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
$(FFMPEG_CONF_ENV) \
diff --git a/package/libvpx/libvpx.mk b/package/libvpx/libvpx.mk
index d6b84ffec37f..2523e7ca9931 100644
--- a/package/libvpx/libvpx.mk
+++ b/package/libvpx/libvpx.mk
@@ -30,7 +30,7 @@ endif
# This is not a true autotools package. It is based on the ffmpeg build system
define LIBVPX_CONFIGURE_CMDS
- (cd $(LIBVPX_SRCDIR) && rm -rf config.cache && \
+ (cd $(@D) && rm -rf config.cache && \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
$(LIBVPX_CONF_ENV) \
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* [Buildroot] [PATCH 17/23] package/perl: apply the perl-cross even for the host variant
2026-10-23 21:51 ` Florian Fainelli via buildroot
` (8 preceding siblings ...)
2026-10-23 21:51 ` [Buildroot] [PATCH 16/23] package/{ffmpeg, libvpx}: use $(@D) instead of $(pkg_SRCDIR) when possible Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-24 10:20 ` François PERRAD
2026-10-23 21:51 ` [Buildroot] [PATCH 18/23] infra/autotools: warn for package that autoreconf without libtool patch Florian Fainelli via buildroot
` (5 subsequent siblings)
15 siblings, 1 reply; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Gary Bisson, Thomas Petazzoni, Petr Vorel, Spenser Gilliland,
Florian Fainelli, Maxime Chevallier, Francois Perrad,
Arnout Vandecappelle, Luca Ceresoli, Thomas Perale, Eric Le Bihan,
Mahyar Koshkouei, Yann E. MORIN, Francois Perrad, Giulio Benetti,
Pascal de Bruijn, Thomas Petazzoni, Jérôme Pouiller,
Bernd Kuhls, Refik Tuzakli, Romain Naour
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
Currently, ther host and target variants have diffeerent source tree,
because the target variant extracts perl-cross, while the host variant
does not.
This goes against having a single source tree for both, to ease
out-of-tree builds.
However, extracting the perl-cross archive has no impact of the standard
build; it only ever adds new files that are not used by the original,
native-only buildsystem.
So, we can extrat perl-cross for the host variant as well, by re-using
the same hook. We also need to apply the config.{sub,guess} hook.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Francois Perrad <francois.perrad@gadz.org>
cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
(cherry picked from commit d2ad97e0eeff39fc89a58b589f19094824402756)
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
package/perl/perl.mk | 2 ++
1 file changed, 2 insertions(+)
diff --git a/package/perl/perl.mk b/package/perl/perl.mk
index 43820cfcc33a..e5d8689776f4 100644
--- a/package/perl/perl.mk
+++ b/package/perl/perl.mk
@@ -31,6 +31,7 @@ define PERL_CROSS_EXTRACT
mv $(@D)/cnf/diffs/perl5-5.42.0 $(@D)/cnf/diffs/perl5-5.42.3
endef
PERL_POST_EXTRACT_HOOKS += PERL_CROSS_EXTRACT
+HOST_PERL_POST_EXTRACT_HOOKS += PERL_CROSS_EXTRACT
# We need to patch perl-cross, but perl-cross is extracted over the
# target perl sources only (and not the host variant). So we apply the
@@ -46,6 +47,7 @@ PERL_POST_PATCH_HOOKS += PERL_CROSS_PATCH
# on newer host architectures, so we borrow the hook which updates them from the
# autotools infrastructure.
PERL_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
+HOST_PERL_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
PERL_DEPENDENCIES += berkeleydb
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* Re: [Buildroot] [PATCH 17/23] package/perl: apply the perl-cross even for the host variant
2026-10-23 21:51 ` [Buildroot] [PATCH 17/23] package/perl: apply the perl-cross even for the host variant Florian Fainelli via buildroot
@ 2026-10-24 10:20 ` François PERRAD
2026-10-27 16:44 ` Florian Fainelli via buildroot
0 siblings, 1 reply; 47+ messages in thread
From: François PERRAD @ 2026-10-24 10:20 UTC (permalink / raw)
To: Florian Fainelli; +Cc: buildroot
[-- Attachment #1.1: Type: text/plain, Size: 2382 bytes --]
The recent commit "package/perl: apply perl-cross patch only on target
perl"
https://gitlab.com/buildroot.org/buildroot/-/commit/8dea6e7c089cb5d4fa7bd788fc6e07c9f19f70a8
must be reverted.
It introduces a third hook PERL_POST_PATCH_HOOKS which becomes useless as
the host & target tree source are now the same.
Francois
Le ven. 23 oct. 2026 à 23:52, Florian Fainelli <
florian.fainelli@broadcom.com> a écrit :
> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
> Currently, ther host and target variants have diffeerent source tree,
> because the target variant extracts perl-cross, while the host variant
> does not.
>
> This goes against having a single source tree for both, to ease
> out-of-tree builds.
>
> However, extracting the perl-cross archive has no impact of the standard
> build; it only ever adds new files that are not used by the original,
> native-only buildsystem.
>
> So, we can extrat perl-cross for the host variant as well, by re-using
> the same hook. We also need to apply the config.{sub,guess} hook.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Francois Perrad <francois.perrad@gadz.org>
> cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> (cherry picked from commit d2ad97e0eeff39fc89a58b589f19094824402756)
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
> ---
> package/perl/perl.mk | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/package/perl/perl.mk b/package/perl/perl.mk
> index 43820cfcc33a..e5d8689776f4 100644
> --- a/package/perl/perl.mk
> +++ b/package/perl/perl.mk
> @@ -31,6 +31,7 @@ define PERL_CROSS_EXTRACT
> mv $(@D)/cnf/diffs/perl5-5.42.0 $(@D)/cnf/diffs/perl5-5.42.3
> endef
> PERL_POST_EXTRACT_HOOKS += PERL_CROSS_EXTRACT
> +HOST_PERL_POST_EXTRACT_HOOKS += PERL_CROSS_EXTRACT
>
> # We need to patch perl-cross, but perl-cross is extracted over the
> # target perl sources only (and not the host variant). So we apply the
> @@ -46,6 +47,7 @@ PERL_POST_PATCH_HOOKS += PERL_CROSS_PATCH
> # on newer host architectures, so we borrow the hook which updates them
> from the
> # autotools infrastructure.
> PERL_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
> +HOST_PERL_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
>
> ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
> PERL_DEPENDENCIES += berkeleydb
> --
> 2.34.1
>
>
[-- Attachment #1.2: Type: text/html, Size: 3648 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 47+ messages in thread
* [Buildroot] [PATCH 18/23] infra/autotools: warn for package that autoreconf without libtool patch
2026-10-23 21:51 ` Florian Fainelli via buildroot
` (9 preceding siblings ...)
2026-10-23 21:51 ` [Buildroot] [PATCH 17/23] package/perl: apply the perl-cross even for the host variant Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 19/23] packages: replace $(PKG)_DIR with @D where possible Florian Fainelli via buildroot
` (4 subsequent siblings)
15 siblings, 0 replies; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Thomas Petazzoni, Eric Le Bihan, Jérôme Pouiller,
Florian Fainelli, Gary Bisson, Romain Naour, Bernd Kuhls,
Thomas Perale, Maxime Chevallier, Refik Tuzakli, Francois Perrad,
Thomas Petazzoni, Arnout Vandecappelle, Petr Vorel,
Spenser Gilliland, Giulio Benetti, Pascal de Bruijn,
Luca Ceresoli, Yann E. MORIN, Mahyar Koshkouei
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
The libtool patch is now implicit because it gets installed for any
package that gets autoreconf-ed, so refusing the libtool patch in that
case is moot anyway.
Error out when this is the case.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
(cherry picked from commit 59aeba1caa1dba75962726904fe712aa6c3e9146)
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
package/pkg-autotools.mk | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
index 89894b9b6cfc..8e1b1b6d40a4 100644
--- a/package/pkg-autotools.mk
+++ b/package/pkg-autotools.mk
@@ -120,6 +120,10 @@ endef
define inner-autotools-package
+ifeq ($$($(2)_AUTORECONF)-$$($(2)_LIBTOOL_PATCH),YES-NO)
+$$(error $(1) must be autoreconf-ed, but refuses the libtool patch)
+endif
+
ifndef $(2)_LIBTOOL_PATCH
ifdef $(3)_LIBTOOL_PATCH
$(2)_LIBTOOL_PATCH = $$($(3)_LIBTOOL_PATCH)
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* [Buildroot] [PATCH 19/23] packages: replace $(PKG)_DIR with @D where possible
2026-10-23 21:51 ` Florian Fainelli via buildroot
` (10 preceding siblings ...)
2026-10-23 21:51 ` [Buildroot] [PATCH 18/23] infra/autotools: warn for package that autoreconf without libtool patch Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 20/23] linux: support custom logo and devicetree files in out-of-tree builds Florian Fainelli via buildroot
` (3 subsequent siblings)
15 siblings, 0 replies; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Thomas Petazzoni, Eric Le Bihan, Jérôme Pouiller,
Florian Fainelli, Gary Bisson, Romain Naour, Bernd Kuhls,
Thomas Perale, Maxime Chevallier, Refik Tuzakli, Francois Perrad,
Thomas Petazzoni, Arnout Vandecappelle, Petr Vorel,
Spenser Gilliland, Giulio Benetti, Pascal de Bruijn,
Luca Ceresoli, Yann E. MORIN, Mahyar Koshkouei
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
Currently, packages that use $(FOO_DIR) (with FOO as the package name)
expect it to be unspecifically either the source or build directory,
with some packages even expecting that it is both. Because it currently
is both.
But when we introduce out-of-tree build and shared host-target source
trees, FOO_DIR will no longer exist, because it can no longer be both.
So, In preparation of that, replace all occurences of $(FOO_DIR) with
@(@D) which is always the dorectory that is the destination of the
current rule.
Note that in some cases, $(@D) is used as the source of a copy or a sed,
and expected to be from the source directory. This will have to be
carefully identified when source and build dirs are separated.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[yann.morin.1998@free.fr:
- reabse on master, convert new packages, drop old ones
- add a commit log
]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
(cherry picked from commit a7e38cf17ada495c3abc1f9bbb377c883a9b4c5a)
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
package/linux-backports/linux-backports.mk | 2 +-
package/ncftp/ncftp.mk | 2 +-
package/pciutils/pciutils.mk | 2 +-
package/php/php.mk | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/package/linux-backports/linux-backports.mk b/package/linux-backports/linux-backports.mk
index 8513a84487a8..e14cd4a1706b 100644
--- a/package/linux-backports/linux-backports.mk
+++ b/package/linux-backports/linux-backports.mk
@@ -33,7 +33,7 @@ LINUX_BACKPORTS_DEPENDENCIES = \
$(BR2_FLEX_HOST_DEPENDENCY)
ifeq ($(BR2_PACKAGE_LINUX_BACKPORTS_USE_DEFCONFIG),y)
-LINUX_BACKPORTS_KCONFIG_FILE = $(LINUX_BACKPORTS_DIR)/defconfigs/$(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_DEFCONFIG))
+LINUX_BACKPORTS_KCONFIG_FILE = $(LINUX_BACKPORTS_SRCDIR)/defconfigs/$(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_DEFCONFIG))
else ifeq ($(BR2_PACKAGE_LINUX_BACKPORTS_USE_CUSTOM_CONFIG),y)
LINUX_BACKPORTS_KCONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_CUSTOM_CONFIG_FILE))
endif
diff --git a/package/ncftp/ncftp.mk b/package/ncftp/ncftp.mk
index 4075449c53e1..1f33270adb92 100644
--- a/package/ncftp/ncftp.mk
+++ b/package/ncftp/ncftp.mk
@@ -37,7 +37,7 @@ NCFTP_DEPENDENCIES += ncurses
endif
define NCFTP_INSTALL_TARGET_CMDS
- $(INSTALL) -m 0755 $(addprefix $(NCFTP_DIR)/bin/, $(NCFTP_TARGET_BINS)) $(TARGET_DIR)/usr/bin
+ $(INSTALL) -m 0755 $(addprefix $(@D)/bin/, $(NCFTP_TARGET_BINS)) $(TARGET_DIR)/usr/bin
$(NCFTP_INSTALL_NCFTP_BATCH)
endef
diff --git a/package/pciutils/pciutils.mk b/package/pciutils/pciutils.mk
index ad32713d579f..52f92db78505 100644
--- a/package/pciutils/pciutils.mk
+++ b/package/pciutils/pciutils.mk
@@ -46,7 +46,7 @@ PCIUTILS_MAKE_OPTS += SHARED=yes
endif
define PCIUTILS_CONFIGURE_CMDS
- $(SED) 's/wget --no-timestamping/wget/' $(PCIUTILS_DIR)/update-pciids.sh
+ $(SED) 's/wget --no-timestamping/wget/' $(@D)/update-pciids.sh
endef
define PCIUTILS_BUILD_CMDS
diff --git a/package/php/php.mk b/package/php/php.mk
index 1bb25d086370..1dd979d7a2a4 100644
--- a/package/php/php.mk
+++ b/package/php/php.mk
@@ -343,7 +343,7 @@ PHP_POST_INSTALL_TARGET_HOOKS += PHP_EXTENSIONS_FIXUP
define PHP_INSTALL_FIXUP
rm -rf $(TARGET_DIR)/usr/lib/php/build
rm -f $(TARGET_DIR)/usr/bin/phpize
- $(INSTALL) -D -m 0755 $(PHP_DIR)/php.ini-production \
+ $(INSTALL) -D -m 0755 $(@D)/php.ini-production \
$(TARGET_DIR)/etc/php.ini
$(SED) 's%;date.timezone =.*%date.timezone = $(PHP_LOCALTIME)%' \
$(TARGET_DIR)/etc/php.ini
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* [Buildroot] [PATCH 20/23] linux: support custom logo and devicetree files in out-of-tree builds
2026-10-23 21:51 ` Florian Fainelli via buildroot
` (11 preceding siblings ...)
2026-10-23 21:51 ` [Buildroot] [PATCH 19/23] packages: replace $(PKG)_DIR with @D where possible Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 21/23] package/linux-tools: support an out-of-tree kernel build Florian Fainelli via buildroot
` (2 subsequent siblings)
15 siblings, 0 replies; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Eric Le Bihan, Gary Bisson, Jérôme Pouiller,
Florian Fainelli, Bernd Kuhls, Thomas Perale, Maxime Chevallier,
Refik Tuzakli, Francois Perrad, Thomas Petazzoni,
Arnout Vandecappelle, Petr Vorel, Spenser Gilliland,
Giulio Benetti, Pascal de Bruijn, Luca Ceresoli, Romain Naour,
Mahyar Koshkouei
A custom logo and custom devicetree files are added to the kernel
sources, which must not be done in a source directory we do not own.
When either is configured for an out-of-tree build, build from a shadow
of the source directory instead: a tree of real directories containing
symlinks to the files (support/scripts/symlink-tree), where files can
be replaced or added without touching the original. Packages opt in by
setting <pkg>_OUT_OF_TREE_SRCDIR.
Custom files are copied with --remove-destination so that a symlink is
replaced rather than written through.
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
linux/linux.mk | 34 ++++++++++++++++-----
package/pkg-generic.mk | 5 +++-
support/scripts/symlink-tree | 58 ++++++++++++++++++++++++++++++++++++
3 files changed, 89 insertions(+), 8 deletions(-)
create mode 100755 support/scripts/symlink-tree
diff --git a/linux/linux.mk b/linux/linux.mk
index ffec32154222..ab1ab4efe400 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -226,7 +226,7 @@ LINUX_DTSO_NAMES += $(basename $(LINUX_DTSO_LIST))
define LINUX_COPY_CUSTOM_DTS_FILES
$(foreach d, $(LINUX_KERNEL_CUSTOM_DTS_DIR), \
@$(call MESSAGE,"Copying devicetree overlay $(d)")$(sep) \
- $(Q)$(call SYSTEM_RSYNC,$(d),$(LINUX_ARCH_PATH)/boot/dts/)$(sep))
+ $(Q)$(call SYSTEM_RSYNC,$(d),$(LINUX_SRC_ARCH_PATH)/boot/dts/)$(sep))
endef
endif
@@ -290,14 +290,18 @@ endif
# for bzImage, arch/i386 and arch/x86_64 do not exist when copying the
# defconfig file.
ifeq ($(KERNEL_ARCH),i386)
-LINUX_ARCH_PATH = $(LINUX_DIR)/arch/x86
+LINUX_ARCH_SUBDIR = arch/x86
else ifeq ($(KERNEL_ARCH),x86_64)
-LINUX_ARCH_PATH = $(LINUX_DIR)/arch/x86
+LINUX_ARCH_SUBDIR = arch/x86
else ifeq ($(KERNEL_ARCH),sparc64)
-LINUX_ARCH_PATH = $(LINUX_DIR)/arch/sparc
+LINUX_ARCH_SUBDIR = arch/sparc
else
-LINUX_ARCH_PATH = $(LINUX_DIR)/arch/$(KERNEL_ARCH)
+LINUX_ARCH_SUBDIR = arch/$(KERNEL_ARCH)
endif
+# Build products (images, dtbs) are in the build directory, but the sources
+# of the kernel, to which custom files are added, may be elsewhere.
+LINUX_ARCH_PATH = $(LINUX_DIR)/$(LINUX_ARCH_SUBDIR)
+LINUX_SRC_ARCH_PATH = $(LINUX_SRCDIR)/$(LINUX_ARCH_SUBDIR)
ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y)
LINUX_IMAGE_PATH = $(LINUX_DIR)/$(LINUX_IMAGE_NAME)
@@ -355,13 +359,29 @@ LINUX_KERNEL_CUSTOM_LOGO_PATH = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_LOGO_PAT
ifneq ($(LINUX_KERNEL_CUSTOM_LOGO_PATH),)
LINUX_DEPENDENCIES += host-imagemagick
define LINUX_KERNEL_CUSTOM_LOGO_CONVERT
+ rm -f $(LINUX_SRCDIR)/drivers/video/logo/logo_linux_clut224.ppm
$(HOST_DIR)/bin/convert $(LINUX_KERNEL_CUSTOM_LOGO_PATH) \
-dither None -colors 224 -compress none \
- $(LINUX_DIR)/drivers/video/logo/logo_linux_clut224.ppm
+ $(LINUX_SRCDIR)/drivers/video/logo/logo_linux_clut224.ppm
endef
LINUX_PRE_BUILD_HOOKS += LINUX_KERNEL_CUSTOM_LOGO_CONVERT
endif
+# A custom logo or custom devicetree files are added to the kernel sources,
+# which we must not do in a source directory we do not own. In an out-of-tree
+# build, use a shadow of that directory instead: a tree of real directories
+# containing symlinks to the files, so that those can be replaced or added.
+ifneq ($(LINUX_OVERRIDE_SRCDIR),)
+ifneq ($(LINUX_KERNEL_CUSTOM_LOGO_PATH)$(LINUX_KERNEL_CUSTOM_DTS_DIR)$(LINUX_CUSTOM_DTS_PATH),)
+LINUX_OUT_OF_TREE_SRCDIR = $(BUILD_DIR)/linux-custom-src
+define LINUX_SHADOW_SRCDIR
+ @$(call MESSAGE,"Shadowing $(LINUX_OVERRIDE_SRCDIR) for custom files")
+ support/scripts/symlink-tree -F -l .git $(call qstrip,$(LINUX_OVERRIDE_SRCDIR)) $(LINUX_OUT_OF_TREE_SRCDIR)
+endef
+LINUX_PRE_RSYNC_HOOKS += LINUX_SHADOW_SRCDIR
+endif
+endif
+
ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
LINUX_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig
else ifeq ($(BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG),y)
@@ -560,7 +580,7 @@ endif
define LINUX_BUILD_CMDS
$(call KCONFIG_DISABLE_OPT,CONFIG_GCC_PLUGINS)
$(foreach dts,$(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)), \
- cp -f $(dts) $(LINUX_ARCH_PATH)/boot/dts/
+ cp -f --remove-destination $(dts) $(LINUX_SRC_ARCH_PATH)/boot/dts/
)
$(LINUX_COPY_CUSTOM_DTS_FILES)
$(LINUX_MAKE_ENV) $(BR2_MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) all
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 066396332099..38a254af1edb 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -575,7 +575,10 @@ $(2)_STAMP_SRCDIR = $$($(2)_SRCDIR)
ifneq ($$($(2)_OVERRIDE_SRCDIR),)
ifeq ($$($(3)_SUPPORTS_OUT_OF_TREE),YES)
$(2)_OUT_OF_TREE = YES
-$(2)_SRCDIR = $$(abspath $$(call qstrip,$$($(2)_OVERRIDE_SRCDIR)))
+# A package may need to add files to its sources, which must not be done in
+# the overridden directory: it can then set <pkg>_OUT_OF_TREE_SRCDIR to
+# a shadow of the sources (see support/scripts/symlink-tree).
+$(2)_SRCDIR = $$(or $$($(3)_OUT_OF_TREE_SRCDIR),$$(abspath $$(call qstrip,$$($(2)_OVERRIDE_SRCDIR))))
$(2)_STAMP_SRCDIR = $$($(2)_BUILDDIR)
endif
endif
diff --git a/support/scripts/symlink-tree b/support/scripts/symlink-tree
new file mode 100755
index 000000000000..6c51022dddad
--- /dev/null
+++ b/support/scripts/symlink-tree
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+
+# Create a "shadow" of a source tree: a tree of real directories whose
+# files are symlinks to the files of the original tree. Files can then be
+# added to, or replaced in, the shadow, and objects can be built inside it,
+# without ever modifying the original tree.
+#
+# Usage: symlink-tree [-F] [-f NAME]... [-l NAME]... SRC DST
+#
+# -F shadow every top-level entry of SRC (default: a single symlink
+# for each top-level entry)
+# -f NAME shadow the top-level directory NAME
+# -l NAME only symlink the top-level entry NAME, even with -F
+#
+# DST is wiped and re-created.
+
+set -e
+
+all=false
+farm=" "
+link=" "
+while getopts "Ff:l:" opt; do
+ case "${opt}" in
+ F) all=true ;;
+ f) farm="${farm}${OPTARG} " ;;
+ l) link="${link}${OPTARG} " ;;
+ *) exit 1 ;;
+ esac
+done
+shift $((OPTIND - 1))
+[ $# -eq 2 ] || { echo "usage: ${0##*/} [-F] [-f NAME]... [-l NAME]... SRC DST" >&2; exit 1; }
+
+src="$(readlink -f "${1}")"
+dst="${2}"
+
+# Refuse to wipe anything that does not look like a previous shadow, or
+# that could be (part of) the source tree.
+dst_abs="$(readlink -m "${dst}")"
+case "${src}/" in
+"${dst_abs}"/*) echo "${0##*/}: ${dst} contains the source tree" >&2; exit 1 ;;
+esac
+case "${dst_abs}/" in
+"${src}"/*) echo "${0##*/}: ${dst} is inside the source tree" >&2; exit 1 ;;
+esac
+
+rm -rf "${dst}"
+mkdir -p "${dst}"
+
+for path in "${src}"/* "${src}"/.[!.]* "${src}"/..?*; do
+ [ -e "${path}" ] || [ -L "${path}" ] || continue
+ name="${path##*/}"
+ if [ -d "${path}" ] && [ ! -L "${path}" ] && [[ "${link}" != *" ${name} "* ]] &&
+ { ${all} || [[ "${farm}" == *" ${name} "* ]]; }; then
+ cp -rs "${path}" "${dst}/"
+ else
+ ln -s "${path}" "${dst}/${name}"
+ fi
+done
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* [Buildroot] [PATCH 21/23] package/linux-tools: support an out-of-tree kernel build
2026-10-23 21:51 ` Florian Fainelli via buildroot
` (12 preceding siblings ...)
2026-10-23 21:51 ` [Buildroot] [PATCH 20/23] linux: support custom logo and devicetree files in out-of-tree builds Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 22/23] package: read kernel headers from LINUX_SRCDIR Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 23/23] docs/manual: document out-of-tree package builds and the new srcdir variables Florian Fainelli via buildroot
15 siblings, 0 replies; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Eric Le Bihan, Gary Bisson, Jérôme Pouiller,
Florian Fainelli, Bernd Kuhls, Thomas Perale, Maxime Chevallier,
Refik Tuzakli, Francois Perrad, Thomas Petazzoni,
Arnout Vandecappelle, Petr Vorel, Spenser Gilliland,
Giulio Benetti, Pascal de Bruijn, Luca Ceresoli, Romain Naour,
Mahyar Koshkouei
The kernel build directory no longer contains the kernel sources, so:
- check which tools the kernel provides against $(LINUX_SRCDIR)/tools
rather than $(LINUX_DIR)/tools;
- build the tools, which build in-tree, in a shadow of the kernel
sources so that the original sources are not modified. When the kernel
is built in-tree, nothing changes.
Also: stop python from writing bytecode next to the real perf scripts,
and make the selftests find the headers installed in the kernel build
directory, which fixes a cold-build failure. The host-built net ynl
selftests are excluded from the target architecture check.
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
package/linux-tools/linux-tool-cpupower.mk.in | 8 ++---
package/linux-tools/linux-tool-gpio.mk.in | 6 ++--
package/linux-tools/linux-tool-hv.mk.in | 6 ++--
package/linux-tools/linux-tool-iio.mk.in | 6 ++--
package/linux-tools/linux-tool-mm.mk.in | 10 +++----
package/linux-tools/linux-tool-pci.mk.in | 12 ++++----
package/linux-tools/linux-tool-perf.mk.in | 29 +++++++++++--------
package/linux-tools/linux-tool-rtla.mk.in | 10 +++----
.../linux-tools/linux-tool-selftests.mk.in | 15 ++++++----
package/linux-tools/linux-tool-tmon.mk.in | 8 ++---
package/linux-tools/linux-tool-usbtools.mk.in | 6 ++--
package/linux-tools/linux-tools.mk | 20 ++++++++++++-
12 files changed, 82 insertions(+), 54 deletions(-)
diff --git a/package/linux-tools/linux-tool-cpupower.mk.in b/package/linux-tools/linux-tool-cpupower.mk.in
index 2a2d3e01dd5a..aca57ff02bcb 100644
--- a/package/linux-tools/linux-tool-cpupower.mk.in
+++ b/package/linux-tools/linux-tool-cpupower.mk.in
@@ -15,26 +15,26 @@ CPUPOWER_MAKE_OPTS = CROSS=$(TARGET_CROSS) \
DEBUG=false
define CPUPOWER_BUILD_CMDS
- $(Q)if test ! -f $(LINUX_DIR)/tools/power/cpupower/Makefile ; then \
+ $(Q)if test ! -f $(LINUX_TOOLS_KSRC)/power/cpupower/Makefile ; then \
echo "Your kernel version is too old and does not have the cpupower tool." ; \
echo "At least kernel 3.4 must be used." ; \
exit 1 ; \
fi
- $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_TOOLS_KDIR)/tools \
$(CPUPOWER_MAKE_OPTS) \
cpupower
endef
define CPUPOWER_INSTALL_STAGING_CMDS
- $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_TOOLS_KDIR)/tools \
$(CPUPOWER_MAKE_OPTS) \
DESTDIR=$(STAGING_DIR) \
cpupower_install
endef
define CPUPOWER_INSTALL_TARGET_CMDS
- $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_TOOLS_KDIR)/tools \
$(CPUPOWER_MAKE_OPTS) \
DESTDIR=$(TARGET_DIR) \
cpupower_install
diff --git a/package/linux-tools/linux-tool-gpio.mk.in b/package/linux-tools/linux-tool-gpio.mk.in
index e825db1b1127..32e3343fc1aa 100644
--- a/package/linux-tools/linux-tool-gpio.mk.in
+++ b/package/linux-tools/linux-tool-gpio.mk.in
@@ -9,19 +9,19 @@ LINUX_TOOLS += gpio
GPIO_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)"
define GPIO_BUILD_CMDS
- $(Q)if ! grep install $(LINUX_DIR)/tools/gpio/Makefile >/dev/null 2>&1 ; then \
+ $(Q)if ! grep install $(LINUX_TOOLS_KSRC)/gpio/Makefile >/dev/null 2>&1 ; then \
echo "Your kernel version is too old and does not have the gpio tools." ; \
echo "At least kernel 4.8 must be used." ; \
exit 1 ; \
fi
- $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools \
+ $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_TOOLS_KDIR)/tools \
$(GPIO_MAKE_OPTS) \
gpio
endef
define GPIO_INSTALL_TARGET_CMDS
- $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools \
+ $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_TOOLS_KDIR)/tools \
$(GPIO_MAKE_OPTS) \
DESTDIR=$(TARGET_DIR) \
gpio_install
diff --git a/package/linux-tools/linux-tool-hv.mk.in b/package/linux-tools/linux-tool-hv.mk.in
index e638fecfc63e..73c20e3ed542 100644
--- a/package/linux-tools/linux-tool-hv.mk.in
+++ b/package/linux-tools/linux-tool-hv.mk.in
@@ -20,13 +20,13 @@ HV_MAKE_OPTS = CC="$(TARGET_CC)" CFLAGS="$(filter-out -g%,$(TARGET_CFLAGS))"
define HV_BUILD_CMDS
$(Q)for prog in $(HV_PROGS_y); do \
- if test ! -f $(LINUX_DIR)/tools/hv/$${prog}.c ; then \
+ if test ! -f $(LINUX_TOOLS_KSRC)/hv/$${prog}.c ; then \
printf "Your kernel version is too old and does not have the HyperV %s tool." "$${prog}" ; \
exit 1 ; \
fi; \
done
- $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/hv \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_TOOLS_KDIR)/tools/hv \
$(HV_MAKE_OPTS) \
$(HV_PROGS_y)
endef
@@ -40,7 +40,7 @@ endif
define HV_INSTALL_TARGET_CMDS
$(foreach prog,$(HV_PROGS_y), \
- $(INSTALL) -m 0755 -D $(LINUX_DIR)/tools/hv/$(prog) \
+ $(INSTALL) -m 0755 -D $(LINUX_TOOLS_KDIR)/tools/hv/$(prog) \
$(TARGET_DIR)/usr/sbin/$(HV_$(prog))
)
$(HV_KVP_HELPER)
diff --git a/package/linux-tools/linux-tool-iio.mk.in b/package/linux-tools/linux-tool-iio.mk.in
index 27ab0ed7ed63..b975a548e473 100644
--- a/package/linux-tools/linux-tool-iio.mk.in
+++ b/package/linux-tools/linux-tool-iio.mk.in
@@ -9,19 +9,19 @@ LINUX_TOOLS += iio
IIO_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)"
define IIO_BUILD_CMDS
- $(Q)if ! grep install $(LINUX_DIR)/tools/iio/Makefile >/dev/null 2>&1 ; then \
+ $(Q)if ! grep install $(LINUX_TOOLS_KSRC)/iio/Makefile >/dev/null 2>&1 ; then \
echo "Your kernel version is too old and does not have install section in the iio tools." ; \
echo "At least kernel 4.7 must be used." ; \
exit 1 ; \
fi
- $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/iio \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_TOOLS_KDIR)/tools/iio \
$(IIO_MAKE_OPTS)
endef
# DESTDIR used since kernel version 4.14
define IIO_INSTALL_TARGET_CMDS
- $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/iio \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_TOOLS_KDIR)/tools/iio \
$(IIO_MAKE_OPTS) \
INSTALL_ROOT=$(TARGET_DIR) \
DESTDIR=$(TARGET_DIR) \
diff --git a/package/linux-tools/linux-tool-mm.mk.in b/package/linux-tools/linux-tool-mm.mk.in
index b2ec090fc086..703d3681ae43 100644
--- a/package/linux-tools/linux-tool-mm.mk.in
+++ b/package/linux-tools/linux-tool-mm.mk.in
@@ -7,16 +7,16 @@
LINUX_TOOLS += mm
define MM_BUILD_CMDS
- $(Q)if test -f $(LINUX_DIR)/tools/vm/Makefile ; then \
+ $(Q)if test -f $(LINUX_TOOLS_KSRC)/vm/Makefile ; then \
MM_SUBDIR=vm; \
- elif test -f $(LINUX_DIR)/tools/mm/Makefile ; then \
+ elif test -f $(LINUX_TOOLS_KSRC)/mm/Makefile ; then \
MM_SUBDIR=mm; \
else \
echo "Your kernel version is too old and does not have the mm tool." ; \
echo "At least kernel 3.4 must be used." ; \
exit 1 ; \
fi ; \
- $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR)/tools \
+ $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_TOOLS_KDIR)/tools \
$(MM_MAKE_OPTS) $${MM_SUBDIR}
endef
@@ -24,12 +24,12 @@ endef
# exists, because that was checked at build time already; we just
# need to find which of the two: if not one, then the other.
define MM_INSTALL_TARGET_CMDS
- $(Q)if test -f $(LINUX_DIR)/tools/vm/Makefile ; then \
+ $(Q)if test -f $(LINUX_TOOLS_KSRC)/vm/Makefile ; then \
MM_SUBDIR=vm; \
else \
MM_SUBDIR=mm; \
fi ; \
- $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_TOOLS_KDIR)/tools \
$(LINUX_MAKE_FLAGS) \
INSTALL_ROOT=$(TARGET_DIR) \
DESTDIR=$(TARGET_DIR) \
diff --git a/package/linux-tools/linux-tool-pci.mk.in b/package/linux-tools/linux-tool-pci.mk.in
index 52d7639bb102..a6f6ef265643 100644
--- a/package/linux-tools/linux-tool-pci.mk.in
+++ b/package/linux-tools/linux-tool-pci.mk.in
@@ -7,11 +7,13 @@
LINUX_TOOLS += pci
# Linux 6.14 moved the PCI endpoint tests into Kselftests.
-PCI_SRCDIR = $(strip $(if $(wildcard $(LINUX_DIR)/tools/testing/selftests/pci_endpoint/Makefile),\
- $(LINUX_DIR)/tools/testing/selftests/pci_endpoint,$(LINUX_DIR)/tools/pci))
+PCI_SUBDIR = $(strip $(if $(wildcard $(LINUX_TOOLS_KSRC)/testing/selftests/pci_endpoint/Makefile),\
+ testing/selftests/pci_endpoint,pci))
+PCI_SRCDIR = $(LINUX_TOOLS_KSRC)/$(PCI_SUBDIR)
+PCI_BUILDDIR = $(LINUX_TOOLS_KDIR)/tools/$(PCI_SUBDIR)
PCI_MAKE_OPTS = $(LINUX_MAKE_FLAGS) \
- OUTPUT=$(PCI_SRCDIR)/ \
+ OUTPUT=$(PCI_BUILDDIR)/ \
LDFLAGS="$(TARGET_LDFLAGS)" \
LDLIBS="-lrt -lm"
@@ -22,12 +24,12 @@ define PCI_BUILD_CMDS
exit 1 ; \
fi
- $(TARGET_MAKE_ENV) $(MAKE) -C $(PCI_SRCDIR) \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(PCI_BUILDDIR) \
$(PCI_MAKE_OPTS)
endef
define PCI_INSTALL_TARGET_CMDS
- $(TARGET_MAKE_ENV) $(MAKE) -C $(PCI_SRCDIR) \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(PCI_BUILDDIR) \
$(PCI_MAKE_OPTS) \
DESTDIR=$(TARGET_DIR) \
INSTALL_PATH=$(TARGET_DIR)/usr/lib/kselftests/pci_endpoint \
diff --git a/package/linux-tools/linux-tool-perf.mk.in b/package/linux-tools/linux-tool-perf.mk.in
index 8c91c2cc6b0f..a2218263a208 100644
--- a/package/linux-tools/linux-tool-perf.mk.in
+++ b/package/linux-tools/linux-tool-perf.mk.in
@@ -18,6 +18,11 @@ else
PERF_ARCH=$(NORMALIZED_ARCH)
endif
+# The python scripts run by the perf build are run through symlinks when
+# building out of tree: do not let python write its bytecode next to the
+# real script, in the kernel sources.
+PERF_MAKE_ENV = PYTHONDONTWRITEBYTECODE=1
+
PERF_MAKE_FLAGS = \
$(LINUX_MAKE_FLAGS) \
JOBS=$(PARALLEL_JOBS) \
@@ -142,25 +147,25 @@ endif
# We name it 'GNUmakefile' so that GNU make will use it instead of
# the existing 'Makefile'.
define PERF_DISABLE_DOCUMENTATION
- if [ -f $(LINUX_DIR)/tools/perf/Documentation/Makefile ]; then \
- printf "%%:\n\t@:\n" >$(LINUX_DIR)/tools/perf/Documentation/GNUmakefile; \
+ if [ -f $(LINUX_TOOLS_KDIR)/tools/perf/Documentation/Makefile ]; then \
+ printf "%%:\n\t@:\n" >$(LINUX_TOOLS_KDIR)/tools/perf/Documentation/GNUmakefile; \
fi
endef
-LINUX_TOOLS_POST_PATCH_HOOKS += PERF_DISABLE_DOCUMENTATION
+LINUX_TOOLS_PRE_CONFIGURE_HOOKS += PERF_DISABLE_DOCUMENTATION
# O must be redefined here to overwrite the one used by Buildroot for
-# out of tree build. We build perf in $(LINUX_DIR)/tools/perf/ and not just
+# out of tree build. We build perf in $(LINUX_TOOLS_KDIR)/tools/perf/ and not just
# $(LINUX_DIR) so that it isn't built in the root directory of the kernel
# sources.
define PERF_BUILD_CMDS
- $(Q)if test ! -f $(LINUX_DIR)/tools/perf/Makefile ; then \
+ $(Q)if test ! -f $(LINUX_TOOLS_KSRC)/perf/Makefile ; then \
echo "Your kernel version is too old and does not have the perf tool." ; \
echo "At least kernel 2.6.31 must be used." ; \
exit 1 ; \
fi
$(Q)if test "$(BR2_PACKAGE_ELFUTILS)" = "" ; then \
- if ! grep -q NO_LIBELF $(LINUX_DIR)/tools/perf/Makefile* ; then \
- if ! test -r $(LINUX_DIR)/tools/perf/config/Makefile ; then \
+ if ! grep -q NO_LIBELF $(LINUX_TOOLS_KSRC)/perf/Makefile* ; then \
+ if ! test -r $(LINUX_TOOLS_KSRC)/perf/config/Makefile ; then \
echo "The perf tool in your kernel cannot be built without libelf." ; \
echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
exit 1 ; \
@@ -168,14 +173,14 @@ define PERF_BUILD_CMDS
fi \
fi
$(Q)if test "$(BR2_PACKAGE_LINUX_TOOLS_PERF_TUI)" = "y" ; then \
- if ! grep -q NO_SLANG $(LINUX_DIR)/tools/perf/Makefile* ; then \
+ if ! grep -q NO_SLANG $(LINUX_TOOLS_KSRC)/perf/Makefile* ; then \
echo "The perf tool in your kernel cannot be build with the TUI." ; \
echo "Either upgrade your kernel to >= 3.10, or disable the TUI." ; \
exit 1 ; \
fi \
fi
- $(TARGET_MAKE_ENV) $(MAKE1) $(PERF_MAKE_FLAGS) \
- -C $(LINUX_DIR)/tools/perf O=$(LINUX_DIR)/tools/perf/
+ $(TARGET_MAKE_ENV) $(PERF_MAKE_ENV) $(MAKE1) $(PERF_MAKE_FLAGS) \
+ -C $(LINUX_TOOLS_KDIR)/tools/perf O=$(LINUX_TOOLS_KDIR)/tools/perf/
endef
# After installation, we remove the Perl and Python scripts from the
@@ -191,8 +196,8 @@ LINUX_TOOLS_BIN_ARCH_EXCLUDE += \
endif
define PERF_INSTALL_TARGET_CMDS
- $(TARGET_MAKE_ENV) $(MAKE1) $(PERF_MAKE_FLAGS) \
- -C $(LINUX_DIR)/tools/perf O=$(LINUX_DIR)/tools/perf/ install
+ $(TARGET_MAKE_ENV) $(PERF_MAKE_ENV) $(MAKE1) $(PERF_MAKE_FLAGS) \
+ -C $(LINUX_TOOLS_KDIR)/tools/perf O=$(LINUX_TOOLS_KDIR)/tools/perf/ install
$(PERF_INSTALL_REMOVE_SCRIPTS)
endef
diff --git a/package/linux-tools/linux-tool-rtla.mk.in b/package/linux-tools/linux-tool-rtla.mk.in
index d9bdcc3016e7..aef4343010c8 100644
--- a/package/linux-tools/linux-tool-rtla.mk.in
+++ b/package/linux-tools/linux-tool-rtla.mk.in
@@ -16,7 +16,7 @@ RTLA_MAKE_OPTS = $(LINUX_MAKE_FLAGS) \
ifeq ($(BR2_TOOLCHAIN_HAS_SSP),)
define RTLA_DISABLE_STACK_PROTECTOR
- $(SED) 's/-fstack-protector.* //' $(LINUX_DIR)/tools/tracing/rtla/Makefile
+ $(SED) 's/-fstack-protector.* //' $(LINUX_TOOLS_KDIR)/tools/tracing/rtla/Makefile
endef
endif
@@ -27,14 +27,14 @@ define RTLA_LINUX_CONFIG_FIXUPS
endef
define RTLA_BUILD_CMDS
- $(Q)if ! grep install $(LINUX_DIR)/tools/tracing/rtla/Makefile >/dev/null 2>&1 ; then \
+ $(Q)if ! grep install $(LINUX_TOOLS_KSRC)/tracing/rtla/Makefile >/dev/null 2>&1 ; then \
echo "Your kernel version is too old and does not implement the rtla tool." ; \
echo "At least kernel 5.19 must be used." ; \
exit 1 ; \
fi
$(RTLA_DISABLE_STACK_PROTECTOR)
$(TARGET_MAKE_ENV) $(MAKE) $(RTLA_MAKE_OPTS) \
- -C $(LINUX_DIR)/tools/tracing rtla
+ -C $(LINUX_TOOLS_KDIR)/tools/tracing rtla
endef
# make rtla_install build and install by default documentation using rst2man
@@ -42,12 +42,12 @@ endef
# folder so let's simply install the resulting rtla binary and create symlinks
# like Linux does in its tools/tracing/rtla/Makefile
define RTLA_INSTALL_TARGET_CMDS
- $(INSTALL) -m 0755 -D $(LINUX_DIR)/tools/tracing/rtla/rtla $(TARGET_DIR)/usr/bin
+ $(INSTALL) -m 0755 -D $(LINUX_TOOLS_KDIR)/tools/tracing/rtla/rtla $(TARGET_DIR)/usr/bin
ln -sf rtla $(TARGET_DIR)/usr/bin/osnoise
ln -sf rtla $(TARGET_DIR)/usr/bin/timerlat
# Check if hwnoise is provided or not
- if grep -q hwnoise $(LINUX_DIR)/tools/tracing/rtla/Makefile; then \
+ if grep -q hwnoise $(LINUX_TOOLS_KSRC)/tracing/rtla/Makefile; then \
ln -sf rtla $(TARGET_DIR)/usr/bin/hwnoise ; \
fi
endef
diff --git a/package/linux-tools/linux-tool-selftests.mk.in b/package/linux-tools/linux-tool-selftests.mk.in
index 032a71e32000..4f25c4a922c1 100644
--- a/package/linux-tools/linux-tool-selftests.mk.in
+++ b/package/linux-tools/linux-tool-selftests.mk.in
@@ -27,11 +27,14 @@ SELFTESTS_MAKE_FLAGS = \
KHDR_DIR=$(LINUX_DIR)/usr/include \
KHDR_INCLUDES="-isystem $(LINUX_DIR)/usr/include"
+# The ynl library of the net selftests is built with the host compiler
LINUX_TOOLS_BIN_ARCH_EXCLUDE += \
- /usr/lib/kselftests/tc-testing/
+ /usr/lib/kselftests/tc-testing/ \
+ /usr/lib/kselftests/net/lib/ynl/ \
+ /usr/lib/kselftests/drivers/net/
# O must be redefined here to overwrite the one used by Buildroot for
-# out of tree build. We build the selftests in $(LINUX_DIR)/tools/selftests and
+# out of tree build. We build the selftests in $(LINUX_TOOLS_KDIR)/tools/selftests and
# not just $(LINUX_DIR) so that it isn't built in the root directory of the kernel
# sources.
#
@@ -43,12 +46,12 @@ LINUX_TOOLS_BIN_ARCH_EXCLUDE += \
define SELFTESTS_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR) $(SELFTESTS_MAKE_FLAGS) \
headers_install
- $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/testing/selftests \
- $(SELFTESTS_MAKE_FLAGS) O=$(LINUX_DIR)/tools/testing/selftests
+ $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_TOOLS_KDIR)/tools/testing/selftests \
+ $(SELFTESTS_MAKE_FLAGS) O=$(LINUX_TOOLS_KDIR)/tools/testing/selftests
endef
define SELFTESTS_INSTALL_TARGET_CMDS
- $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/testing/selftests \
- $(SELFTESTS_MAKE_FLAGS) O=$(LINUX_DIR)/tools/testing/selftests \
+ $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_TOOLS_KDIR)/tools/testing/selftests \
+ $(SELFTESTS_MAKE_FLAGS) O=$(LINUX_TOOLS_KDIR)/tools/testing/selftests \
INSTALL_PATH=$(TARGET_DIR)/usr/lib/kselftests install
endef
diff --git a/package/linux-tools/linux-tool-tmon.mk.in b/package/linux-tools/linux-tool-tmon.mk.in
index 56c328c51fd7..cb071f5fee12 100644
--- a/package/linux-tools/linux-tool-tmon.mk.in
+++ b/package/linux-tools/linux-tool-tmon.mk.in
@@ -14,24 +14,24 @@ TMON_MAKE_OPTS = $(LINUX_MAKE_FLAGS) \
ifeq ($(BR2_TOOLCHAIN_HAS_SSP),)
define TMON_DISABLE_STACK_PROTECTOR
- $(SED) 's%-fstack-protector%%' $(LINUX_DIR)/tools/thermal/tmon/Makefile
+ $(SED) 's%-fstack-protector%%' $(LINUX_TOOLS_KDIR)/tools/thermal/tmon/Makefile
endef
endif
define TMON_BUILD_CMDS
- $(Q)if ! grep install $(LINUX_DIR)/tools/thermal/tmon/Makefile >/dev/null 2>&1 ; then \
+ $(Q)if ! grep install $(LINUX_TOOLS_KSRC)/thermal/tmon/Makefile >/dev/null 2>&1 ; then \
echo "Your kernel version is too old and does not have the tmon tool." ; \
echo "At least kernel 3.13 must be used." ; \
exit 1 ; \
fi
$(TMON_DISABLE_STACK_PROTECTOR)
- $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_TOOLS_KDIR)/tools \
$(TMON_MAKE_OPTS) \
tmon
endef
define TMON_INSTALL_TARGET_CMDS
- $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_TOOLS_KDIR)/tools \
$(TMON_MAKE_OPTS) \
INSTALL_ROOT=$(TARGET_DIR) \
tmon_install
diff --git a/package/linux-tools/linux-tool-usbtools.mk.in b/package/linux-tools/linux-tool-usbtools.mk.in
index 797758adce51..6e72fe6de79a 100644
--- a/package/linux-tools/linux-tool-usbtools.mk.in
+++ b/package/linux-tools/linux-tool-usbtools.mk.in
@@ -13,20 +13,20 @@ LINUX_TOOLS_USBTOOLS_LIST = \
$(if $(BR2_PACKAGE_LINUX_TOOLS_USBTOOLS_FFSTEST),ffs-test)
define USBTOOLS_BUILD_CMDS
- $(Q)if ! grep install $(LINUX_DIR)/tools/usb/Makefile >/dev/null 2>&1 ; then \
+ $(Q)if ! grep install $(LINUX_TOOLS_KSRC)/usb/Makefile >/dev/null 2>&1 ; then \
echo "Your kernel version is too old to build the USB tools." ; \
echo "At least kernel 5.9 must be used." ; \
exit 1 ; \
fi
- $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/usb \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_TOOLS_KDIR)/tools/usb \
ALL_TARGETS="$(LINUX_TOOLS_USBTOOLS_LIST)" \
$(USBTOOLS_MAKE_OPTS) \
all
endef
define USBTOOLS_INSTALL_TARGET_CMDS
- $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/usb \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_TOOLS_KDIR)/tools/usb \
ALL_TARGETS="$(LINUX_TOOLS_USBTOOLS_LIST)" \
$(USBTOOLS_MAKE_OPTS) \
DESTDIR=$(TARGET_DIR) \
diff --git a/package/linux-tools/linux-tools.mk b/package/linux-tools/linux-tools.mk
index 49e73a9ca4ec..c1b13af0dd4c 100644
--- a/package/linux-tools/linux-tools.mk
+++ b/package/linux-tools/linux-tools.mk
@@ -8,7 +8,25 @@
# Instead, we directly build in the sources of the linux package. We can do
# that, because we're not building in the same location and the same files.
#
-# So, all tools refer to $(LINUX_DIR) instead of $(@D).
+# So, all tools refer to $(LINUX_TOOLS_KDIR) to build, instead of $(@D).
+#
+# Which tools can be built, though, is checked against the kernel sources
+# in $(LINUX_SRCDIR), which is not $(LINUX_DIR), the kernel build directory,
+# when the kernel is built out of tree.
+#
+# The tools build in-tree, and we do not want to pollute the kernel sources
+# of an out-of-tree build. So in that case, we build in a shadow of the
+# kernel sources, which is a tree of real directories with symlinks to the
+# files.
+LINUX_TOOLS_KSRC = $(LINUX_SRCDIR)/tools
+LINUX_TOOLS_KDIR = $(if $(LINUX_OUT_OF_TREE),$(LINUX_TOOLS_BUILDDIR)/linux,$(LINUX_DIR))
+
+define LINUX_TOOLS_SHADOW_SOURCES
+ $(if $(LINUX_OUT_OF_TREE),\
+ support/scripts/symlink-tree -f tools $(LINUX_SRCDIR) $(LINUX_TOOLS_KDIR))
+endef
+# Must come first, before the hooks that tweak the kernel sources
+LINUX_TOOLS_PRE_CONFIGURE_HOOKS += LINUX_TOOLS_SHADOW_SOURCES
# Note: we need individual tools makefiles to be included *before* we build
# the list of build and install hooks below to guarantee that each tool has
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* [Buildroot] [PATCH 22/23] package: read kernel headers from LINUX_SRCDIR
2026-10-23 21:51 ` Florian Fainelli via buildroot
` (13 preceding siblings ...)
2026-10-23 21:51 ` [Buildroot] [PATCH 21/23] package/linux-tools: support an out-of-tree kernel build Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
2026-10-23 21:51 ` [Buildroot] [PATCH 23/23] docs/manual: document out-of-tree package builds and the new srcdir variables Florian Fainelli via buildroot
15 siblings, 0 replies; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Eric Le Bihan, Gary Bisson, Jérôme Pouiller,
Florian Fainelli, Bernd Kuhls, Thomas Perale, Maxime Chevallier,
Refik Tuzakli, Francois Perrad, Thomas Petazzoni,
Arnout Vandecappelle, Petr Vorel, Spenser Gilliland,
Giulio Benetti, Pascal de Bruijn, Luca Ceresoli, Romain Naour,
Mahyar Koshkouei
When the kernel is built out of tree, LINUX_DIR is the build directory and
does not contain the source headers.
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
package/a10disp/a10disp.mk | 2 +-
package/freescale-imx/imx-alsa-plugins/imx-alsa-plugins.mk | 2 +-
package/freescale-imx/imx-lib/imx-lib.mk | 2 +-
package/gstreamer1/gst1-imx/gst1-imx.mk | 2 +-
package/x11r7/xdriver_xf86-video-imx/xdriver_xf86-video-imx.mk | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/package/a10disp/a10disp.mk b/package/a10disp/a10disp.mk
index c919202329c4..a7ba85fb5a42 100644
--- a/package/a10disp/a10disp.mk
+++ b/package/a10disp/a10disp.mk
@@ -12,7 +12,7 @@ A10DISP_LICENSE_FILES = a10disp.c
A10DISP_DEPENDENCIES = linux
define A10DISP_BUILD_CMDS
- cp -f $(LINUX_DIR)/include/video/sunxi_disp_ioctl.h $(@D)/
+ cp -f $(LINUX_SRCDIR)/include/video/sunxi_disp_ioctl.h $(@D)/
$(TARGET_CC) $(TARGET_CFLAGS) $(@D)/a10disp.c -o $(@D)/a10disp
endef
diff --git a/package/freescale-imx/imx-alsa-plugins/imx-alsa-plugins.mk b/package/freescale-imx/imx-alsa-plugins/imx-alsa-plugins.mk
index 912cc7c68bcb..e153738a5ef4 100644
--- a/package/freescale-imx/imx-alsa-plugins/imx-alsa-plugins.mk
+++ b/package/freescale-imx/imx-alsa-plugins/imx-alsa-plugins.mk
@@ -15,6 +15,6 @@ IMX_ALSA_PLUGINS_AUTORECONF = YES
# needs access to imx-specific kernel headers
IMX_ALSA_PLUGINS_DEPENDENCIES += linux
-IMX_ALSA_PLUGINS_CONF_ENV += CPPFLAGS="$(TARGET_CPPFLAGS) -idirafter $(LINUX_DIR)/include/uapi"
+IMX_ALSA_PLUGINS_CONF_ENV += CPPFLAGS="$(TARGET_CPPFLAGS) -idirafter $(LINUX_SRCDIR)/include/uapi"
$(eval $(autotools-package))
diff --git a/package/freescale-imx/imx-lib/imx-lib.mk b/package/freescale-imx/imx-lib/imx-lib.mk
index f06453e8a6be..3048deb96053 100644
--- a/package/freescale-imx/imx-lib/imx-lib.mk
+++ b/package/freescale-imx/imx-lib/imx-lib.mk
@@ -15,7 +15,7 @@ IMX_LIB_INSTALL_STAGING = YES
# imx-lib needs access to imx-specific kernel headers
IMX_LIB_DEPENDENCIES += linux
IMX_LIB_INCLUDE = \
- -idirafter $(LINUX_DIR)/include/uapi
+ -idirafter $(LINUX_SRCDIR)/include/uapi
IMX_LIB_MAKE_ENV = \
$(TARGET_MAKE_ENV) \
diff --git a/package/gstreamer1/gst1-imx/gst1-imx.mk b/package/gstreamer1/gst1-imx/gst1-imx.mk
index f091b4f9832b..ebeccc3bd66f 100644
--- a/package/gstreamer1/gst1-imx/gst1-imx.mk
+++ b/package/gstreamer1/gst1-imx/gst1-imx.mk
@@ -23,7 +23,7 @@ GST1_IMX_CONF_OPTS = --prefix="/usr"
ifeq ($(BR2_LINUX_KERNEL),y)
# IPU and PXP need access to imx-specific kernel headers
GST1_IMX_DEPENDENCIES += linux
-GST1_IMX_CONF_OPTS += --kernel-headers="$(LINUX_DIR)/include"
+GST1_IMX_CONF_OPTS += --kernel-headers="$(LINUX_SRCDIR)/include"
endif
ifeq ($(BR2_PACKAGE_IMX_CODEC),y)
diff --git a/package/x11r7/xdriver_xf86-video-imx/xdriver_xf86-video-imx.mk b/package/x11r7/xdriver_xf86-video-imx/xdriver_xf86-video-imx.mk
index b80c6b77335e..3f2602268d36 100644
--- a/package/x11r7/xdriver_xf86-video-imx/xdriver_xf86-video-imx.mk
+++ b/package/x11r7/xdriver_xf86-video-imx/xdriver_xf86-video-imx.mk
@@ -9,6 +9,6 @@ XDRIVER_XF86_VIDEO_IMX_SOURCE = xserver-xorg-video-imx-$(XDRIVER_XF86_VIDEO_IMX_
XDRIVER_XF86_VIDEO_IMX_SITE = $(FREESCALE_IMX_SITE)
XDRIVER_XF86_VIDEO_IMX_DEPENDENCIES = linux libz160 xserver_xorg-server \
xorgproto
-XDRIVER_XF86_VIDEO_IMX_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -I$(LINUX_DIR)/include"
+XDRIVER_XF86_VIDEO_IMX_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -I$(LINUX_SRCDIR)/include"
$(eval $(autotools-package))
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread* [Buildroot] [PATCH 23/23] docs/manual: document out-of-tree package builds and the new srcdir variables
2026-10-23 21:51 ` Florian Fainelli via buildroot
` (14 preceding siblings ...)
2026-10-23 21:51 ` [Buildroot] [PATCH 22/23] package: read kernel headers from LINUX_SRCDIR Florian Fainelli via buildroot
@ 2026-10-23 21:51 ` Florian Fainelli via buildroot
15 siblings, 0 replies; 47+ messages in thread
From: Florian Fainelli via buildroot @ 2026-10-23 21:51 UTC (permalink / raw)
To: buildroot
Cc: Eric Le Bihan, Gary Bisson, Jérôme Pouiller,
Florian Fainelli, Bernd Kuhls, Thomas Perale, Maxime Chevallier,
Refik Tuzakli, Francois Perrad, Thomas Petazzoni,
Arnout Vandecappelle, Petr Vorel, Spenser Gilliland,
Giulio Benetti, Pascal de Bruijn, Luca Ceresoli, Romain Naour,
Mahyar Koshkouei
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
docs/manual/adding-packages-generic.adoc | 11 +++++++
docs/manual/using-buildroot-development.adoc | 30 ++++++++++++++++++++
2 files changed, 41 insertions(+)
diff --git a/docs/manual/adding-packages-generic.adoc b/docs/manual/adding-packages-generic.adoc
index e7547460fd50..9c0e9baa117a 100644
--- a/docs/manual/adding-packages-generic.adoc
+++ b/docs/manual/adding-packages-generic.adoc
@@ -666,6 +666,17 @@ In the action definitions, you can use the following variables:
* +$(@D)+, which contains the directory in which the package source
code has been uncompressed.
+* +$(LIBFOO_SRCDIR)+ is the directory containing the package sources,
+ +$(LIBFOO_SRCSUBDIR)+ is the same directory with +LIBFOO_SUBDIR+
+ appended, and +$(LIBFOO_BUILDDIR)+ is the directory in which the package
+ is built. By default, these all point to +$(@D)+, but they can differ:
+ build systems that build out of source set +$(LIBFOO_BUILDDIR)+ to a
+ sub-directory, and a package built out of tree from an
+ +LIBFOO_OVERRIDE_SRCDIR+ has its sources in the overridden directory. A
+ recipe that only reads the package sources (for example to copy a header)
+ should use +$(LIBFOO_SRCDIR)+ rather than +$(@D)+, which is the build
+ directory. See xref:outoftree-build[] for more details.
+
* +$(LIBFOO_DL_DIR)+ contains the path to the directory where all the downloads
made by Buildroot for +libfoo+ are stored in.
diff --git a/docs/manual/using-buildroot-development.adoc b/docs/manual/using-buildroot-development.adoc
index 72628e0a6f99..bc9ad5d7ab94 100644
--- a/docs/manual/using-buildroot-development.adoc
+++ b/docs/manual/using-buildroot-development.adoc
@@ -119,3 +119,33 @@ cost of a slower speed, add these directories back:
----
LINUX_OVERRIDE_SRCDIR_RSYNC_EXCLUSIONS = --include .git
----
+
+[[outoftree-build]]
+===== Building out of tree with +<pkg>_OVERRIDE_SRCDIR+
+
+A package can opt in to being built out of tree by setting
++LIBFOO_SUPPORTS_OUT_OF_TREE = YES+. For such a package, when
++LIBFOO_OVERRIDE_SRCDIR+ is set, Buildroot does not _rsync_ the sources to
++output/build/<package>-custom/+. Instead, the package is built from the
+overridden directory, with all the generated files, including the stamp
+files, stored in +output/build/<package>-custom/+. The overridden directory
+is therefore not modified by the build. The +<pkg>_PRE_RSYNC_HOOKS+ and
++<pkg>_POST_RSYNC_HOOKS+ hooks are still run, but +$(@D)+ then does not
+contain the sources: hooks should use +$(LIBFOO_SRCDIR)+ to access them.
+
+Currently the +linux+ package supports this. The kernel source tree must be
+clean (no +.config+, +include/config+ or +arch/*/include/generated+, as
+required by the kernel when using +O=+); run +make mrproper+ in it if
+needed. The kernel is configured and built with +O=+ pointing to
++output/build/linux-custom/+.
+
+When a custom logo (+BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH+) or custom device
+tree files (+BR2_LINUX_KERNEL_CUSTOM_DTS_PATH+) are used, or when
++linux-tools+ are enabled, Buildroot has to add files to, or build inside,
+the kernel sources. To avoid modifying the overridden directory, it then
+builds from a _shadow_ copy: a tree of real directories containing
+symbolic links to the files of the original tree, created by
++support/scripts/symlink-tree+.
+
+Packages that read files from the kernel sources, such as headers, must use
++$(LINUX_SRCDIR)+ and not +$(LINUX_DIR)+.
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 47+ messages in thread