Search code examples
yoctobitbakeopenembedded

Yocto/OpenEmbedded Recipe Including library paths from host


I have the luxury of dealing with the endless error and warning paradise that is OpenEmbedded. Good news is that I am finally getting somewhere with my recipe, but I am hitting an issue where my recipe is including include and library paths from my host machine. This as I am aware is unsafe for cross-compilation. Would any of you fine people take like quick look at my recipe and tell me if I'm doing anything dumb? I'd really appreciate it, as this is making me feel like I'm a complete moron.

Here's my 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
}

And here are my warnings:

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.

Solution

  • It is exactly what the warning is telling you in your bitbake output warning. The files are processed and installed however there is no reference to them in the output hence why they are not shipped.

    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]

    Include the files in your Yocto 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
    }
    
    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 \
    "
    

    or alternatively the easier way would just be to use a wildcard which catches everything

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