Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] infra/pkg-kconfig: build host-ccache before kconfig
@ 2018-07-19  9:47 翟召轩
  2018-07-19 11:01 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: 翟召轩 @ 2018-07-19  9:47 UTC (permalink / raw)
  To: buildroot

When the ccache is enabled, the HOSTCC variable refers to the ccache binary.

But the host-ccache is not a dependency of the kconfig's .config. Some targets
such as `busybox-menuconfig` may calls Kconfig before the host-ccache is ready.
If the host-ccache is not ready yet, the Kconfig will fail. Because it can not
use $HOSTCC to build its utilities without ccache.

This issue can be reproduce with the following commands:
 1. make clean defconfig
 2. echo "BR2_CCACHE=y" >> .config
 3. make olddefconfig busybox-menuconfig

This patch fixes this issue by add host-ccache to the dependencies of .config.
So that the Kconfig can use $HOSTCC.

Signed-off-by: Zhai Zhaoxuan <zhaizhaoxuan@xiaomi.com>
---
 package/pkg-kconfig.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
index 81bba5220c..44bcda4cd2 100644
--- a/package/pkg-kconfig.mk
+++ b/package/pkg-kconfig.mk
@@ -54,6 +54,10 @@ $(2)_KCONFIG_FIXUP_CMDS ?=
 $(2)_KCONFIG_FRAGMENT_FILES ?=
 $(2)_KCONFIG_DOTCONFIG ?= .config
 
+ifeq ($(BR2_CCACHE),y)
+$(2)_KCONFIG_DEPENDENCIES += host-ccache
+endif
+
 # The config file as well as the fragments could be in-tree, so before
 # depending on them the package should be extracted (and patched) first.
 #
@@ -108,7 +112,7 @@ endef
 # fragments are merged together to .config, after the package has been patched.
 # Since the file could be a defconfig file it needs to be expanded to a
 # full .config first.
-$$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG): $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES)
+$$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG): $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES) $$($(2)_KCONFIG_DEPENDENCIES)
 	$$(Q)$$(if $$($(2)_KCONFIG_DEFCONFIG), \
 		$$($(2)_KCONFIG_MAKE) $$($(2)_KCONFIG_DEFCONFIG), \
 		$$(INSTALL) -m 0644 -D $$($(2)_KCONFIG_FILE) $$(@))
-- 
2.18.0

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

end of thread, other threads:[~2018-07-19 12:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-19  9:47 [Buildroot] [PATCH] infra/pkg-kconfig: build host-ccache before kconfig 翟召轩
2018-07-19 11:01 ` Thomas Petazzoni
2018-07-19 12:18   ` 翟召轩

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox