将yocto morty更新为thud后

时间:2019-07-09 13:31:53

标签: linux-kernel yocto bitbake

我在yocto morty上使用的是'linux-toradex-4.1-2.0.x-imx',一切都还好。但是在将所有图层更新为'Thud'版本之后,我得到了内核do_compile错误:

Sstate summary: Wanted 624 Found 66 Missed 558 Current 689 (10% match, 57% complete)
NOTE: Executing SetScene Tasks
WARNING: Variable key RDEPENDS_${KERNEL_PACKAGE_NAME}-base (${KERNEL_PACKAGE_NAME}-image) replaces original key RDEPENDS_kernel-base ( kernel-devicetree kernel-image).
ERROR: linux-toradex-samim-4.1-2.0.x-r0 do_compile: oe_runmake failed
ERROR: linux-toradex-samim-4.1-2.0.x-r0 do_compile: Function failed: do_compile (log file is located at /opt/yocto/toradex-morty/poky/build/tmp-glibc/work/colibri_imx6-angstrom-linux-gnueabi/linux-toradex-samim/4.1-2.0.x-r0/temp/log.do_compile.23716)
ERROR: Logfile of failure stored in: /opt/yocto/toradex-morty/poky/build/tmp-glibc/work/colibri_imx6-angstrom-linux-gnueabi/linux-toradex-samim/4.1-2.0.x-r0/temp/log.do_compile.23716
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 8 HOSTCC=gcc  -isystem/opt/yocto/toradex-morty/poky/build/tmp-glibc/work/colibri_imx6-angstrom-linux-gnueabi/linux-toradex-samim/4.1-2.0.x-r0/recipe-sysroot-native/usr/include -O2 -pipe -L/opt/yocto/toradex-morty/poky/build/tmp-glibc/work/colibri_imx6-angstrom-linux-gnueabi/linux-toradex-samim/4.1-2.0.x-r0/recipe-sysroot-native/usr/lib -L/opt/yocto/toradex-morty/poky/build/tmp-glibc/work/colibri_imx6-angstrom-linux-gnueabi/linux-toradex-samim/4.1-2.0.x-r0/recipe-sysroot-native/lib -Wl,-rpath-link,/opt/yocto/toradex-morty/poky/build/tmp-glibc/work/colibri_imx6-angstrom-linux-gnueabi/linux-toradex-samim/4.1-2.0.x-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link,/opt/yocto/toradex-morty/poky/build/tmp-glibc/work/colibri_imx6-angstrom-linux-gnueabi/linux-toradex-samim/4.1-2.0.x-r0/recipe-sysroot-native/lib -Wl,-rpath,/opt/yocto/toradex-morty/poky/build/tmp-glibc/work/colibri_imx6-angstrom-linux-gnueabi/linux-toradex-samim/4.1-2.0.x-r0/recipe-sysroot-native/usr/lib -Wl,-rpath,/opt/yocto/toradex-morty/poky/build/tmp-glibc/work/colibri_imx6-angstrom-linux-gnueabi/linux-toradex-samim/4.1-2.0.x-r0/recipe-sysroot-native/lib -Wl,-O1 HOSTCPP=gcc  -E uImage CC=arm-angstrom-linux-gnueabi-gcc  -mno-thumb-interwork -marm -fuse-ld=bfd -fdebug-prefix-map=/opt/yocto/toradex-morty/poky/build/tmp-glibc/work/colibri_imx6-angstrom-linux-gnueabi/linux-toradex-samim/4.1-2.0.x-r0=/usr/src/debug/linux-toradex-samim/4.1-2.0.x-r0 -fdebug-prefix-map=/opt/yocto/toradex-morty/poky/build/tmp-glibc/work/colibri_imx6-angstrom-linux-gnueabi/linux-toradex-samim/4.1-2.0.x-r0/recipe-sysroot= -fdebug-prefix-map=/opt/yocto/toradex-morty/poky/build/tmp-glibc/work/colibri_imx6-angstrom-linux-gnueabi/linux-toradex-samim/4.1-2.0.x-r0/recipe-sysroot-native=  -fdebug-prefix-map=/opt/yocto/toradex-morty/poky/build/tmp-glibc/work-shared/colibri-imx6/kernel-source=/usr/src/kernel   LD=arm-angstrom-linux-gnueabi-ld.bfd   LOADADDR=0x10008000
|   GEN     ./Makefile
| scripts/kconfig/conf  --silentoldconfig Kconfig
|   CHK     include/config/kernel.release
|   UPD     include/config/kernel.release
|   GEN     ./Makefile
|   WRAP    arch/arm/include/generated/asm/bitsperlong.h
|   WRAP    arch/arm/include/generated/asm/cputime.h
|   WRAP    arch/arm/include/generated/asm/current.h

.
.
.
...after some warnings...
.
.
|                  from /opt/yocto/toradex-morty/poky/build/tmp-glibc/work-shared/colibri-imx6/kernel-source/include/linux/crypto.h:21,
|                  from /opt/yocto/toradex-morty/poky/build/tmp-glibc/work-shared/colibri-imx6/kernel-source/include/crypto/algapi.h:15,
|                  from /opt/yocto/toradex-morty/poky/build/tmp-glibc/work-shared/colibri-imx6/kernel-source/crypto/ghash-generic.c:15:
| /opt/yocto/toradex-morty/poky/build/tmp-glibc/work-shared/colibri-imx6/kernel-source/include/linux/log2.h:22:1: warning: ignoring attribute 'noreturn' because it conflicts with attribute 'const' [-Wattributes]
|  int ____ilog2_NaN(void);
|  ^~~
|   LD      crypto/crypto_blkcipher.o
|   LD      crypto/crypto_hash.o
|   LD      crypto/cryptomgr.o
|   LD      crypto/built-in.o
| Makefile:146: recipe for target 'sub-make' failed
| make[1]: *** [sub-make] Error 2
| Makefile:24: recipe for target '__sub-make' failed
| make: *** [__sub-make] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /opt/yocto/toradex-morty/poky/build/tmp-glibc/work/colibri_imx6-angstrom-linux-gnueabi/linux-toradex-samim/4.1-2.0.x-0/temp/log.do_compile.10534)

内核配方为:

require recipes-kernel/linux/linux-imx.inc
include conf/tdx_version.conf

SUMMARY = "Linux kernel for Toradex Freescale i.MX based modules"

SRC_URI = "git://git@git.myco.int/kernel/linux-toradex-4.1-2.0.x-imx.git;protocol=ssh;branch=${SRCBRANCH} \
        file://defconfig \
        file://0002-Add-APP-K7-board-support.patch \
        "

# Load USB functions configurable through configfs (CONFIG_USB_CONFIGFS)
KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('COMBINED_FEATURES', 'usbgadget', ' libcomposite', '',d)}"

LOCALVERSION = "-${TDX_VER_ITEM}"
# PV_append = "+git${SRCPV}"

SRCREV = "e420b7a49300560485af191ec63887d27da577db"
SRCBRANCH = "toradex_4.1-2.0.x-imx"

DEPENDS += "lzop-native bc-native"
COMPATIBLE_MACHINE = "(mx7|mx6)"

# defaults
TDX_VER_ITEM ??= "0"

inherit kernel

在“ meta-toradex-nxp”层中,我只看到了“ linux-toradex_4.9-2.3.x.bb”,而不是4.1-2.0.x,这很重要吗?我还需要在配方中添加一些其他内容以与“ Thud”一起编译吗?

我的bblayers.conf也是:

# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "7"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  ${TOPDIR}/../meta-myproj \
  \
  ${TOPDIR}/../meta-angstrom \
  \
  ${TOPDIR}/../meta-toradex-nxp \
  ${TOPDIR}/../meta-freescale \
  ${TOPDIR}/../meta-freescale-3rdparty \
  \
  ${TOPDIR}/../meta-toradex-bsp-common \
  \
  ${TOPDIR}/../meta-snappy \
  \
  ${TOPDIR}/../meta-linaro/meta-linaro-toolchain \
  ${TOPDIR}/../meta-openembedded/meta-oe \
  ${TOPDIR}/../meta-openembedded/meta-gnome \
  ${TOPDIR}/../meta-openembedded/meta-initramfs \
  ${TOPDIR}/../meta-openembedded/meta-networking \
  ${TOPDIR}/../meta-openembedded/meta-multimedia \
  ${TOPDIR}/../meta-openembedded/meta-python \
  ${TOPDIR}/../meta-openembedded/meta-webserver \
  \
  ${TOPDIR}/../meta-openembedded/meta-filesystems \
  \
  ${TOPDIR}/../meta-lxde \
  ${TOPDIR}/../meta-qt5 \
  ${TOPDIR}/../meta-qt5-extra \
  ${TOPDIR}/../meta-toradex-demos \
  ${TOPDIR}/../meta-freescale-distro \
  ${TOPDIR}/../meta-poky \
  ${TOPDIR}/../meta-browser \
  ${TOPDIR}/../meta-swupdate \
  \
  \
  ${TOPDIR}/../meta \
"

非常感谢您。

更新:谢谢@Marcel,我检查了yocto manual并说:“默认情况下,现在默认使用GNU Compiler Collection 8.2版进行编译。如果您仍需要使用该版本进行编译还提供了7.x,GCC 7.3。您可以通过设置和来选择此版本,也可以通过在配置中将GCCVERSION变量设置为“ 7.%”来选择。”

然后我也在conf / local.conf中插入'GCCVERSION =“ 7.%”',但不幸的是,它仍然无法正常工作。

1 个答案:

答案 0 :(得分:3)

请注意,Thud使用的是更高版本的gcc编译器(准确地说是8.3)。不幸的是,过时的Linux内核4.1无法使用此类gcc 8.3进行编译,因此您需要向后移植几个补丁才能使该组合起作用。另外请注意,OpenEmbedded通常会将任何警告视为错误,您可能还希望通过编译标志将其禁用,否则,所需补丁的数量将是无穷无尽的。总体而言,更好的方法可能是适当地采用后来仍受支持的Linux内核,例如toradex_4.14-2.0.x-imx,我们现在正式将其迁移到BSP 3.0b2中。