【问题标题】:kernel compile error after update yocto morty to thud将 yocto morty 更新为 thud 后内核编译错误
【发布时间】:2019-11-19 01:59:17
【问题描述】:

我在 yocto morty 上使用了 'linux-toradex-4.1-2.0.x-imx',一切正常。但在将所有层和 poky 更新为“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.%”来选择。”

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

【问题讨论】:

  • 在编译新版本之前您是否正确清理了构建环境(thud)? OTOH,“重要吗?”是什么意思?如果你愿意,你也可以升级你的内核。
  • 你不通过toradex-bsp-platform使用这个Toradex环境吗?
  • @danlor 是的,我已经完全使用了另一个构建目录。只是下载文件夹是为“Thud”和“Morty”共享的。关于内核,不,实际上我不想升级内核,我将在 morty 中使用我的内核,即 4.1-2.0。
  • @Nayfe 不,我不使用它。我也需要吗?
  • 您不需要使用它,但它有助于选择层和配方的版本,因为它们已经过 Toradex 的测试。

标签: linux-kernel yocto bitbake


【解决方案1】:

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

【讨论】:

  • 非常感谢,您完全正确。就像手册说'...还提供了 GCC 7.3',我是否也可以使用 gcc 7.3 来编译内核 4.1?
猜你喜欢
  • 2017-11-13
  • 2017-07-30
  • 2010-12-06
  • 2018-06-26
  • 1970-01-01
  • 2015-10-14
  • 2018-04-19
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多