0

我正在尝试将 cmocka 放入嵌入式 Linux 目标板。
我使用 Yocto 创建了 rootfs,并为 cmocka-1.1.5 添加了自定义配方。cmocka 共享库是使用我的自定义 bitbake 配方生成的,但是当我尝试使用bitbake core-image-sato它构建完整图像时失败并出现以下错误:

ERROR: cmocka-1.1.5-1.0+AUTOINC+546bd50924-r0 do_package_qa: QA Issue: non -dev/-dbg/nativesdk- package contains symlink .so: cmocka-1.1.5 path '/work/aarch64-poky-linux/cmocka-1.1.5/1.0+AUTOINC+546bd50924-r0/packages-split/cmocka-1.1.5/usr/lib/libcmocka.so' [dev-so]
ERROR: cmocka-1.1.5-1.0+AUTOINC+546bd50924-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.
ERROR: cmocka-1.1.5-1.0+AUTOINC+546bd50924-r0 do_package_qa: 
ERROR: cmocka-1.1.5-1.0+AUTOINC+546bd50924-r0 do_package_qa: Function failed: do_package_qa
ERROR: Logfile of failure stored in: /mnt/Drive_2/odroid-yocto/build/tmp/work/aarch64-poky-linux/cmocka-1.1.5/1.0+AUTOINC+546bd50924-r0/temp/log.do_package_qa.22650
ERROR: Task (/mnt/Drive_2/odroid-yocto/meta-xeb360/recipes-cmocka/cmocka-1.1.5/cmocka-1.1.5.bb:do_package_qa) failed with exit code '1'  

我的自定义 bitbake 配方cmocka-1.1.5.bb如下所示:

DESCRIPTION = "An elegant unit testing framework for C with support for mock objects"
SECTION = "Unit Testing"
LICENSE = "GPLv3"

PR = "r0"

LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"

SRCREV = "${AUTOREV}"
PVBASE := "${PV}"
PV = "${PVBASE}+${SRCPV}"

SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git"

S = "${WORKDIR}/git"

inherit pkgconfig cmake

EXTRA_OECMAKE = ""

PACKAGES = "${PN} ${PN}-dev ${PN}-dbg ${PN}-staticdev"

RDEPENDS_${PN}-staticdev = ""
RDEPENDS_${PN}-dev = ""
RDEPENDS_${PN}-dbg = ""

do_configure() { 
 cd ${S}/../build/
 cmake -DCMAKE_INSTALL_PREFIX=${exec_prefix} ../git/
}

do_compile() {
    cd ${S}/../build/
    oe_runmake
}

INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
SOLIBS = ".so*"
SOLIBSDEV += ".so"
FILES_SOLIBSDEV = ""

FILES_${PN}-dev = "\
    ${libdir}/lib*${SOLIBS} \
    ${includedir} \
    ${libdir}/pkgconfig \
    ${libdir}/cmake \
    ${libdir}/cmake/cmocka \
    ${libdir}/cmake/cmocka/cmocka-config.cmake \
    ${libdir}/cmake/cmocka/cmocka-config-version.cmake \
"  

谁能让我知道我错过了什么或我做错了什么?

4

1 回答 1

3

这个食谱可以简化如下。一些正在运行的构造是不需要的。

DESCRIPTION = "\
cmocka is an elegant unit testing framework for C with support for mock \
objects. It only requires the standard C library, works on a range of computing \
platforms (including embedded) and with different compilers."

LICENSE = "Apache-2.0"

LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"

SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git"

SRCREV = "546bd50924245f4ca7292a3ef6a92504aa375455"

PV = "1.1.5+git${SRCPV}"

S = "${WORKDIR}/git"

inherit pkgconfig cmake
于 2019-07-16T05:40:27.623 回答