[lkml]   [2015]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 2/6] kbuild: mergeconfig: move an error check to
Currently, "make tinyconfig" does not work with "-j" option.

$ make mrproper
$ make -j8 tinyconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --allnoconfig Kconfig
# configuration written to .config
scripts/kconfig/Makefile:122: *** You need an existing .config
for this target. Stop.
make: *** [tinyconfig] Error 2

As shown above, "allnoconfig" has created the .config file before
mergeconfig is called, but Make still raises a false alarm because
of some sort of race condition.

We can fix this issue by moving the error check to the shell script.

Anyway, scripts/kconfig/ always requires an existing
.config as a base file. It is reasonable to check its existence in
the shell script.

Signed-off-by: Masahiro Yamada <>

scripts/kconfig/Makefile | 1 -
scripts/kconfig/ | 5 +++++
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index fc34f46..be0fad4 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -107,7 +107,6 @@ endif
configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config)

define mergeconfig
-$(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
$(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture))
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/ -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1))
+$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
diff --git a/scripts/kconfig/ b/scripts/kconfig/
index 2118af8..88d89b2 100755
--- a/scripts/kconfig/
+++ b/scripts/kconfig/
@@ -85,6 +85,11 @@ fi

+if [ ! -r "$INITFILE" ]; then
+ echo "The base file '$INITFILE' does not exist. Exit." >&2
+ exit 1
SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)

 \ /
  Last update: 2015-03-13 08:01    [W:0.057 / U:16.092 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site