代码之家  ›  专栏  ›  技术社区  ›  md.jamal

无法在yocto中安装共享库

  •  0
  • md.jamal  · 技术社区  · 6 年前

    SUMMARY = "test library"
    SRC_URI = " file://file1.c \
                file://file2.c \
                file://internal.h" 
    
    LICENSE = "CLOSED"
    FILES_${PN} = "libtest.so"
    do_compile() {
        ${CC} -fPIC -c ${WORKDIR}/file1.c -o ${WORKDIR}/file1.o
        ${CC} -fPIC -c ${WORKDIR}/file2.c -o ${WORKDIR}/file2.o
        ${CC} -shared -o ${WORKDIR}/libesys.so ${WORKDIR}/file1.o ${WORKDIR}/file2.o 
    }
    
    do_install() {
        install -d ${D}${libdir}
        install -m 0644 ${WORKDIR}/libtest.so ${D}${libdir}/
    }
    

    ERROR: test-0.1-r0 do_package_qa: QA Issue: -dev package contains non-symlink .so: test-dev path '/work/corei7-64-poky-linux/test/0.1-r0/packages-split/test-dev/usr/lib64/libtest.so' [dev-elf]
    ERROR: test-0.1-r0 do_package_qa: QA Issue: No GNU_HASH in the elf binary: '/home/jamal/repotest1/build/tmp/work/corei7-64-poky-linux/test/0.1-r0/packages-split/test-dev/usr/lib64/libtest.so' [ldflags]
    ERROR: test-0.1-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.
    ERROR: test-0.1-r0 do_package_qa: Function failed: do_package_qa
    ERROR: Logfile of failure stored in: /home/jamal/repotest1/build/tmp/work/corei7-64-poky-linux/test/0.1-r0/temp/log.do_package_qa.20989
    ERROR: Task (/home/jamal/repotest1/sources/meta-test/recipes-support/test/test_0.1.bb:do_package_qa) failed with exit code '1'
    

    1 回复  |  直到 6 年前
        1
  •  1
  •   Ross Burton    6 年前

    默认打包规则假定库已版本化,而您的库未版本化。

    安装版本库,或者如果您确实不想安装 https://wiki.yoctoproject.org/wiki/TipsAndTricks/Packaging_Prebuilt_Libraries#Non-versioned_Libraries 演示如何操作规则。

        2
  •  0
  •   yuandi    3 年前
    LICENSE = "CLOSED"
    
    SRC_URI = "file://greetings.c \
                       file://greetings.h \
                       "
    S = "${WORKDIR}"
    TARGET_CC_ARCH += "${LDFLAGS}"
    
    #INHIBIT_PACKAGE_STRIP = "1"
    #INHIBIT_SYSROOT_STRIP = "1"
    SOLIBS = ".so"
    FILES_SOLIBSDEV = ""
    
    do_configure () {
                    # Specify any needed configure commands here
                    :
    }
    
    do_compile () {
            ${CC} -fPIC -c ${WORKDIR}/greetings.c -o ${WORKDIR}/greetings.o
            ${CC} -shared -o ${WORKDIR}/libtest.so ${WORKDIR}/greetings.o 
            #g++ -fPIC -shared -Wl,-soname,libtest.so.1 -o libtest.so.1.1.0
    }
    
    
    do_install () {
            install -d ${D}${libdir}
            install -d ${D}${includedir}
    #oe_soinstall ${WORKDIR}/libtest.so ${D}${libdir}
            install -m 0644 ${WORKDIR}/libtest.so ${D}${libdir}
            install -m 0755 ${S}/*.h ${D}${includedir}
    }