Yocto 错误: "非调试包含 .debug 目录" 与 Yocto 配方配方

14

我正在尝试构建一个自定义的Yocto配方,其中涉及编译一个小型C程序。在构建过程中 -

$ bitbake -f interface-configuration
...
ERROR: QA Issue: non debug package contains .debug directory: interface-configuration path /work/cortexa9hf-vfp-poky-linux-gnueabi/interface-configuration/0.1-r0/packages-split/interface-configuration/etc/interfaces/bin/.debug/set
ERROR: QA run found fatal errors. Please consider fixing them.
ERROR: Function failed: do_package_qa
ERROR: Logfile of failure stored in: /home/git/poky/build-atmel/tmp/work/cortexa9hf-vfp-poky-linux-gnueabi/interface-configuration/0.1-r0/temp/log.do_package.28986
ERROR: Task 10 (/home/git/poky/meta-atmel/recipes-intelli/interface-configuration/interface-configuration_0.1.bb, do_package) failed with exit code '1'

我想知道这里是否有人知道如何禁用调试信息或删除QA检查。到目前为止,对该错误进行的谷歌搜索没有取得任何成果。
干杯!
使用interface-configuration.bb更新。
DESCRIPTION = "Interface configuration files and tools"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
SRC_URI = "file://interface-configuration-0.1.tar.gz"

do_compile() {
    install -vd ${D}/
    ${CC} -g0 set.c -o set
    # CC is arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mtune=cortex-a9 --sysroot=/home/git/poky/build-atmel/tmp/sysroots/sama5d3xek
}


do_install() {
    cp -r ${S}/etc ${D}/etc
    install -vd ${D}/etc/interfaces/bin
    install -vm 0755 set ${D}/etc/interfaces/bin/
}

do_install_append() {
    # I added this to try to remove the error - it doesn't work
    rm -rf ${D}/etc/interfaces/bin/.debug
}

FILES_${PN} += "/etc/interfaces/MANIFEST \
    /etc/interfaces/conf/A \
    /etc/interfaces/conf/B \
    /etc/interfaces/conf/C \
    /etc/interfaces/conf/D \
    /etc/interfaces/template/A \
    /etc/interfaces/template/B \
    /etc/interfaces/template/C \
    /etc/interfaces/template/D \
    /set.c"

请发布您的 interface-configuration_0.1.bb 文件。您将一个调试目录 /etc/interfaces/bin/.debug 放在了非调试软件包中。 - silvio
@silvio 我已经更新了描述,加入了.bb文件。 - user1407764
3个回答

16
Yocto/OE会在二进制文件所在的目录下生成一个名为.debug的目录。如果您对于某个二进制文件使用了非默认的目录(例如:install -vm 0755 set ${D}/etc/interfaces/bin),则需要声明将.debug放入-dbg包中。
现在有两种选择。第一种是使用标准目录,例如${D}/usr/bin;第二种是将.debug添加到-dbg包中,如下所示:
FILES_${PN}-dbg += "/etc/interfaces/bin/.debug"
你可以移除你的do_install_append,因为.debug是在do_install之后创建的。 如果你使用第二个选项,你需要在gdb中使用set debug-file-directory directories选项配置你的gdb以调试二进制文件。在这里阅读更多信息:here

感谢提供有用的信息,但是需要进行小修正,就像@Inmx所说的那样,.debug文件是由软件包生成而不是安装产生的。 - hyuk myeong

13

.debug目录是在meta/classes/package.bbclass中的split_and_strip_files函数的一部分自动生成的。

该函数接收从do_install得到的文件并将其拆分为多个软件包:${PN}包含基本文件和剥离的二进制文件,${PN}-dbg包含调试符号等。

您可以通过在.bb文件中添加以下内容来抑制split_and_strip_files

INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"

我认为你也想简化从你的 .bb 生成的软件包列表为:

PACKAGES = "${PN}"

当用户不想创建PN-dbg时,这将非常有帮助,这不是默认情况。因此,必须处理将它们拆分为不同包的情况。 - Vishnu N K

0

如果你想跳过所有的配方包

你可以在你的 ".bb" 文件中添加以下行来跳过 QA 问题

关于已安装与已发货的问题:

INSANE_SKIP_${PN} = "installed-vs-shipped"

针对分离包问题:

INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

希望这对你有用。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接