Yocto / OpenEmbedded配方包括来自主机的库路径

时间:2017-11-08 20:26:57

标签: yocto bitbake openembedded

我可以奢侈地处理OpenEmbedded的无尽错误和警告天堂。好消息是我终于得到了我的食谱,但我遇到的问题是我的食谱包括来自我的主机的包含和库路径。据我所知,这对于交叉编译是不安全的。难道你们中的任何一个人都会快速看看我的食谱然后告诉我,我是不是在做任何愚蠢的事情?我真的很感激,因为这让我觉得我是个完全白痴。

这是我的OpenEmbedded Recipe:

#TODO fixup license type
#Built by Rob.

DESCRIPTION = "librem" 
HOMEPAGE = ""
SECTION = "meta-miku"
DEPENDS = "zlib re"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

# This tells bitbake where to find the files we're providing on the local filesystem
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"

S = "${WORKDIR}/rem-0.5.2"
INSANE_SKIP_${PN}-dev += "dev-elf"
#INSANE_SKIP_${PN} += "installed-vs-shipped"

SRC_URI = "https://github.com/creytiv/rem/archive/v0.5.2.tar.gz"
SRC_URI[md5sum] = "4d63ab174fb7957b6805fd0de6991fd2"
SRC_URI[sha256sum] = "cef1b29631a35926982502f0eecc0950d40d2585241d0598ff18e70e2dfcfcb6"

do_compile() {
oe_runmake ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}" 
}

do_install () {
oe_runmake install ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}" DESTDIR=${D}${libdir}
install -d ${D}${libdir}/
install -m 0644 ${S}/librem.a ${D}${libdir}/librem.a
install -m 0644 ${S}/librem.so ${D}${libdir}/librem.so
install -d ${D}${libdir}/pkgconfig
install -m 0644 ${S}/librem.pc ${D}${libdir}/pkgconfig/librem.pc
}

以下是我的警告:

WARNING: rem-1.0-r0 do_package: QA Issue: rem: Files/directories were installed but not shipped in any package:
  /usr/lib64/usr/include
  /usr/lib64/usr/include/rem
  /usr/lib64/usr/include/rem/rem_auconv.h
  /usr/lib64/usr/include/rem/rem_fir.h
  /usr/lib64/usr/include/rem/rem_aumix.h
  /usr/lib64/usr/include/rem/rem_video.h
  /usr/lib64/usr/include/rem/rem_audio.h
  /usr/lib64/usr/include/rem/rem_vidconv.h
  /usr/lib64/usr/include/rem/rem_dtmf.h
  /usr/lib64/usr/include/rem/rem_aubuf.h
  /usr/lib64/usr/include/rem/rem_au.h
  /usr/lib64/usr/include/rem/rem_dsp.h
  /usr/lib64/usr/include/rem/rem_vidmix.h
  /usr/lib64/usr/include/rem/rem_vid.h
  /usr/lib64/usr/include/rem/rem_goertzel.h
  /usr/lib64/usr/include/rem/rem_auresamp.h
  /usr/lib64/usr/include/rem/rem_autone.h
  /usr/lib64/usr/include/rem/rem_g711.h
  /usr/lib64/usr/include/rem/rem_aufile.h
  /usr/lib64/usr/include/rem/rem.h
  /usr/lib64/usr/lib/librem.a
  /usr/lib64/usr/lib/librem.so
  /usr/lib64/usr/lib/pkgconfig
  /usr/lib64/usr/lib/pkgconfig/librem.pc
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
rem: 24 installed and not shipped files. [installed-vs-shipped]
WARNING: rem-1.0-r0 do_package_qa: QA Issue: rem: The compile log indicates that host include and/or library paths were used.
         Please check the log '/media/rob/a72581e8-3ca3-4dc1-b3b8-6db5464de098/qc_openEmbedded/apps_proc/build/tmp-glibc/work/aarch64-linaro-linux/rem/1.0-r0/temp/log.do_compile' for more information. [compile-host-path]
WARNING: rem-1.0-r0 do_package_qa: QA Issue: No GNU_HASH in the elf binary: '/media/rob/a72581e8-3ca3-4dc1-b3b8-6db5464de098/qc_openEmbedded/apps_proc/build/tmp-glibc/work/aarch64-linaro-linux/rem/1.0-r0/packages-split/rem-dev/usr/lib64/librem.so' [ldflags]
NOTE: Tasks Summary: Attempted 420 tasks of which 407 didn't need to be rerun and all succeeded.
NOTE: Writing buildhistory

Summary: There were 4 WARNING messages shown.

1 个答案:

答案 0 :(得分:0)

这正是警告在你的bitbake输出警告中告诉你的。这些文件经过处理和安装,但输出中没有对它们的引用,因此它们没有发货。

  

请设置FILES以便打包这些项目。或者如果   它们是不需要的,避免安装或删除它们   do_install。 rem:24个已安装且未发送的文件。   [安装-VS-运]

在Yocto配方中包含文件:

#TODO fixup license type
#Built by Rob.

DESCRIPTION = "librem" 
HOMEPAGE = ""
SECTION = "meta-miku"
DEPENDS = "zlib re"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

# This tells bitbake where to find the files we're providing on the local filesystem
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"

S = "${WORKDIR}/rem-0.5.2"
INSANE_SKIP_${PN}-dev += "dev-elf"
#INSANE_SKIP_${PN} += "installed-vs-shipped"

SRC_URI = "https://github.com/creytiv/rem/archive/v0.5.2.tar.gz"
SRC_URI[md5sum] = "4d63ab174fb7957b6805fd0de6991fd2"
SRC_URI[sha256sum] = "cef1b29631a35926982502f0eecc0950d40d2585241d0598ff18e70e2dfcfcb6"

do_compile() {
    oe_runmake ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}" 
}

do_install () {
    oe_runmake install ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}" DESTDIR=${D}${libdir}
    install -d ${D}${libdir}/
    install -m 0644 ${S}/librem.a ${D}${libdir}/librem.a
    install -m 0644 ${S}/librem.so ${D}${libdir}/librem.so
    install -d ${D}${libdir}/pkgconfig
    install -m 0644 ${S}/librem.pc ${D}${libdir}/pkgconfig/librem.pc
}

FILES_${PN} += "\
    /usr/lib64/usr/include \ 
    /usr/lib64/usr/include/rem \
    /usr/lib64/usr/include/rem/rem_auconv.h \
    /usr/lib64/usr/include/rem/rem_fir.h \
    /usr/lib64/usr/include/rem/rem_aumix.h \
    /usr/lib64/usr/include/rem/rem_video.h \
    /usr/lib64/usr/include/rem/rem_audio.h \
    /usr/lib64/usr/include/rem/rem_vidconv.h \
    /usr/lib64/usr/include/rem/rem_dtmf.h \
    /usr/lib64/usr/include/rem/rem_aubuf.h \
    /usr/lib64/usr/include/rem/rem_au.h \
    /usr/lib64/usr/include/rem/rem_dsp.h \
    /usr/lib64/usr/include/rem/rem_vidmix.h \
    /usr/lib64/usr/include/rem/rem_vid.h \
    /usr/lib64/usr/include/rem/rem_goertzel.h \
    /usr/lib64/usr/include/rem/rem_auresamp.h \
    /usr/lib64/usr/include/rem/rem_autone.h \
    /usr/lib64/usr/include/rem/rem_g711.h \
    /usr/lib64/usr/include/rem/rem_aufile.h \
    /usr/lib64/usr/include/rem/rem.h \
    /usr/lib64/usr/lib/librem.a \
    /usr/lib64/usr/lib/librem.so \
    /usr/lib64/usr/lib/pkgconfig \
    /usr/lib64/usr/lib/pkgconfig/librem.pc \
"

或者更简单的方法就是使用捕捉所有内容的通配符

FILES_${PN} += "/usr/lib64/usr/*"