[OpenWrt-Devel] [PATCH] build: fix kernel_*config targets on 4.19

Petr Štetiar ynezz at true.cz
Wed Jun 19 02:36:56 EDT 2019

Recent kernel versions need toolchain in order to properly configure
kernel, for example to set CC_HAS_ASM_GOTO config symbol, so missing
toolchain leads to the following error while running `make
kernel_oldconfig` on ath79 target with 4.19 kernel in the clean tree:

 init/Kconfig:17: syntax error
 init/Kconfig:16: invalid option
 ./scripts/clang-version.sh: line 15: mips-openwrt-linux-musl-gcc: command not found
 ./scripts/gcc-plugin.sh: line 11: mips-openwrt-linux-musl-gcc: command not found
 net/sched/Kconfig:44: warning: menuconfig statement without prompt
 make[4]: *** [scripts/kconfig/Makefile:69: oldconfig] Error 1

So in order to support this new kernel versions, this patch adds
toolchain as a hard dependency to the kernel_*config targets.

Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
Signed-off-by: Petr Štetiar <ynezz at true.cz>

BTW we've tried to enable this dependency only for kernel versions > 4.14, but
it's a challenge as either CONFIG_LINUX_4_* or kernel_patchver_* doesn't work
in toplevel.mk or toolchain/install is not available in target/linux/Makefile,
so it would probably need some refactoring which is probably not worth the
effort as 4.14 days are numbered anyway.

 include/toplevel.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/toplevel.mk b/include/toplevel.mk
index 36f790f8072a..133da9d830b5 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -145,7 +145,7 @@ xconfig: scripts/config/qconf prepare-tmpinfo FORCE
 	$< Config.in
-prepare_kernel_conf: .config FORCE
+prepare_kernel_conf: .config toolchain/install FORCE
 ifeq ($(wildcard staging_dir/host/bin/quilt),)

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list