You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Yocto构建QEMU时遇Hexagon目标编译错误求助

Yocto构建QEMU for AM62xx-EVM时Hexagon目标编译错误

我的Yocto recipe如下:

SUMMARY = "QEMU for aarch64 architecture"
DESCRIPTION = "QEMU for emulating the aarch64 architecture, fetched from upstream Git."

LICENSE = "GPLv2 & LGPLv2.1"
LIC_FILES_CHKSUM = "file://LICENSE;md5=6541297aed25bfd5e8d893ea097e838c"


SRC_URI = "git://gitlab.com/qemu-project/qemu.git;protocol=https"
SRC_URI += "file:///home/jenkins/dev/mkonov/dtc/dtc"

SRCREV = "134b443512825bed401b6e141447b8cdc22d2efe"

DEPENDS = "flex-native bison-native meson pkgconfig pkgconfig-native glib-2.0 libftdi pixman zlib ninja-native"


S = "${WORKDIR}/git"


do_configure() {

    ./configure
}

do_compile() {
    oe_runmake
}

do_install() {
    install -d ${D}${bindir}
    install -m 0755 qemu-system-aarch64 ${D}${bindir}/qemu-system-aarch64
}

执行configure后,完成keycodemapdb子项目构建时出现以下错误:

| Executing subproject keycodemapdb
|
| keycodemapdb| Project name: keycodemapdb
| keycodemapdb| Project version: undefined
| keycodemapdb| Program tools/keymap-gen found: YES (/home/jenkins/dev/yocto/poky/qemu_build/tmp/work/aarch64-poky-linux/qemu-system-aarch64-recipe/1.0-r0/git/subprojects/keycodemapdb/tools/keymap-gen)
| keycodemapdb| Build targets in project: 349
| keycodemapdb| Subproject keycodemapdb finished.
|
| Program scripts/decodetree.py found: YES (/home/jenkins/dev/yocto/poky/qemu_build/tmp/work/aarch64-poky-linux/qemu-system-aarch64-recipe/1.0-r0/git/build/pyvenv/bin/python3 /home/jenkins/dev/yocto/poky/qemu_build/tmp/work/aarch64-poky-linux/qemu-system-aarch64-recipe/1.0-r0/git/scripts/decodetree.py)
|
| ../target/hexagon/meson.build:29:16: ERROR: No build machine compiler for 'target/hexagon/gen_semantics.c'
|
| A full log can be found at /home/jenkins/dev/yocto/poky/qemu_build/tmp/work/aarch64-poky-linux/qemu-system-aarch64-recipe/1.0-r0/git/build/meson-logs/meson-log.txt
|
| ERROR: meson setup failed
|
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/jenkins/dev/yocto/poky/meta-tisdk-qemu/recipes-core/qemu-system-aarch64-recipe/qemu-system-aarch64-recipe.bb:do_configure) failed with exit code '1'

我尝试添加gcc、g++、cmake等依赖,但问题未解决,求帮助。


解决方法

1. 禁用不需要的Hexagon目标(推荐)

你要构建的是aarch64架构的QEMU,不需要Hexagon目标支持。修改do_configure()函数,指定只编译aarch64相关目标:

do_configure() {
    ./configure --target-list=aarch64-softmmu \
                --prefix=${prefix} \
                --sysconfdir=${sysconfdir} \
                --bindir=${bindir}
}

--target-list=aarch64-softmmu会让QEMU只编译aarch64系统模拟器,跳过Hexagon等其他目标,从根源避免该错误。

2. 配置主机编译器(如果必须保留Hexagon目标)

如果确实需要Hexagon支持,需要确保Yocto为build机器提供C编译器。在DEPENDS中添加gcc-native,并在configure时指定主机编译器:

DEPENDS += "gcc-native"

do_configure() {
    CC_FOR_BUILD=${BUILD_CC} ./configure
}

${BUILD_CC}是Yocto提供的主机编译器变量,能让QEMU正确找到编译gen_semantics.c所需的主机工具。

内容的提问来源于stack exchange,提问作者ElbowBlock

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 06:05:20