我正在尝试将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
"
任何人都可以让我知道我错过了什么或我做错了什么吗?
这个食谱可以简化一点,如下所示。不需要某些结构。
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