[yocto] No rule to make target 'zImage'

Nicolas Jeker n.jeker at delisys.ch
Thu Oct 3 07:28:14 PDT 2019


On Tue, 2019-10-01 at 07:16 +1000, JH wrote:
> Hi,
> 
> I am building Yocto, it stopped at building kernel "No rule to make
> target 'zImage'", what I could be missing?
> 

I encountered the same problem when building a custom kernel. It works
perfectly fine when I'm building it outside of yocto.

First, I want to document the steps I followed.

My yocto version is thud. I followed the Kernel Development Manual and
used the recipe from the skeleton layer as a base and created the
following recipe:


inherit kernel siteinfo
require recipes-kernel/linux/linux-yocto.inc

LIC_FILES_CHKSUM =
"file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"

KCONFIG_MODE = "--alldefconfig"

SRC_URI = "git://git.toradex.com/linux-
toradex.git;protocol=git;nocheckout=1;branch=${SRCBRANCH} \
           file://defconfig \
           file://imx6q-apalis-
ixora.dts;subdir=git/arch/${ARCH}/boot/dts"

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

LINUX_VERSION ?= "5.2"
LINUX_VERSION_EXTENSION_append = "-delisys"

SRCREV="74e785ce1024471e77b6fb9da83ffd60762c8cac"
SRCBRANCH = "toradex_5.2.y"

PV = "5.2.7"

DEPENDS += "lzop-native bc-native"
COMPATIBLE_MACHINE = "(apalis-imx6)"
KARCH = "arm"
KMACHINE = "apalis-imx6"
KBRANCH = "toradex_5.2.y"


When I build the kernel, I get the following error:


| DEBUG: Executing shell function do_compile
| NOTE: make -j 8 HOSTCC=gcc  -
isystem/home/build/build/tmp/work/apalis_imx6-tdx-linux-gnueabi/linux-
stable/5.2.7-r0/recipe-sysroot-native/usr/include -O2 -pipe
-L/home/build/build/tmp/work/apalis_imx6-tdx-linux-gnueabi/linux-
stable/5.2.7-r0/recipe-sysroot-native/usr/lib                         -
L/home/build/build/tmp/work/apalis_imx6-tdx-linux-gnueabi/linux-
stable/5.2.7-r0/recipe-sysroot-native/lib                         -Wl,-
rpath-link,/home/build/build/tmp/work/apalis_imx6-tdx-linux-
gnueabi/linux-stable/5.2.7-r0/recipe-sysroot-
native/usr/lib                         -Wl,-rpath-
link,/home/build/build/tmp/work/apalis_imx6-tdx-linux-gnueabi/linux-
stable/5.2.7-r0/recipe-sysroot-native/lib                         -Wl,-
rpath,/home/build/build/tmp/work/apalis_imx6-tdx-linux-gnueabi/linux-
stable/5.2.7-r0/recipe-sysroot-native/usr/lib                         -
Wl,-rpath,/home/build/build/tmp/work/apalis_imx6-tdx-linux-
gnueabi/linux-stable/5.2.7-r0/recipe-sysroot-
native/lib                         -Wl,-O1 -Wl,--allow-shlib-undefined
-Wl,--dynamic-linker=/home/build/build/tmp/sysroots-uninative/x86_64-
linux/lib/ld-linux-x86-64.so.2 HOSTCPP=gcc  -E zImage CC=arm-tdx-linux-
gnueabi-gcc  -mno-thumb-interwork -marm -fuse-ld=bfd -fdebug-prefix-
map=/home/build/build/tmp/work/apalis_imx6-tdx-linux-gnueabi/linux-
stable/5.2.7-r0=/usr/src/debug/linux-stable/5.2.7-
r0                      -fdebug-prefix-
map=/home/build/build/tmp/work/apalis_imx6-tdx-linux-gnueabi/linux-
stable/5.2.7-r0/recipe-sysroot=                      -fdebug-prefix-
map=/home/build/build/tmp/work/apalis_imx6-tdx-linux-gnueabi/linux-
stable/5.2.7-r0/recipe-sysroot-native=  -fdebug-prefix-
map=/home/build/build/tmp/work-shared/apalis-imx6/kernel-
source=/usr/src/kernel   LD=arm-tdx-linux-gnueabi-ld.bfd
| make: *** No rule to make target 'zImage'.  Stop.
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.



I experimented a little with the devshell and the problem seems to be
that the HOSTCC and HOSTCPP variables are not surrounded by quotes. I
couldn't figure out why this is happening. Did you find a solution?

Regards,
Nicolas



More information about the yocto mailing list