【问题标题】:How to resolve error this bitbake build error: undefined reference to symbol 'ERR_reason_error_string@@OPENSSL_1_1_0'如何解决此 bitbake 构建错误的错误:未定义对符号“ERR_reason_error_string@@OPENSSL_1_1_0”的引用
【发布时间】:2021-12-03 00:30:20
【问题描述】:

我正在尝试将 do-client 集成到我的 yocto 图像中,以 raspberrypi4 为目标。

我的食谱文件:

LICENSE = "CLOSED"

DO_SRC_URI ?= "gitsm://github.com/microsoft/do-client;branch=main"
SRC_URI = "${DO_SRC_URI}"
SRCREV = "cd2eaadc0755c93bb31234a19a4577aced9845e5"

python () {
    src_uri = d.getVar('DO_SRC_URI')
    if src_uri.startswith('git'):
        d.setVar('PV', '1.0+git' + d.getVar('SRCPV'))
        d.setVar('S', d.getVar('WORKDIR') + "/git")
    elif src_uri.startswith('file'):
        d.setVar('S',  d.getVar('WORKDIR') + "/do-client")
}

DEPENDS = "boost cpprest libproxy msft-gsl"

inherit cmake

BUILD_TYPE ?= "Debug"
EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}"
# Don't build DO tests.
EXTRA_OECMAKE += "-DDO_BUILD_TESTS=OFF"
# Specify build is for deliveryoptimization-agent
EXTRA_OECMAKE += "-DDO_INCLUDE_AGENT=ON"


# cpprest installs its config.cmake file in a non-standard location.
# Tell cmake where to find it.
EXTRA_OECMAKE += "-Dcpprestsdk_DIR=${WORKDIR}/recipe-sysroot/usr/lib/cmake"
BBCLASSEXTEND = "native nativesdk"

错误信息:

/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++  -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0=/usr/src/debug/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0                      -fdebug-prefix-map=/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0=/usr/src/debug/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0                      -fdebug-prefix-map=/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot=                      -fdebug-prefix-map=/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden  -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot -Wall -fPIE -pie -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wformat -Werror=format-security -fmerge-all-constants -Wno-noexcept-type -g -DDEBUG  -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0=/usr/src/debug/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0                      -fdebug-prefix-map=/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0=/usr/src/debug/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0                      -fdebug-prefix-map=/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot=                      -fdebug-prefix-map=/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden  -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -pie -z relro -z now client-lite/CMakeFiles/deliveryoptimization-agent.dir/src/exe/docs.cpp.o  -o client-lite/deliveryoptimization-agent  client-lite/common/lib-doversion/libdoversion.a  client-lite/libdocs_common.a  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libcpprest.so.2.10  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_random.so.1.72.0  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_system.so.1.72.0  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_thread.so.1.72.0  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_filesystem.so.1.72.0  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_chrono.so.1.72.0  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_atomic.so.1.72.0  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_date_time.so.1.72.0  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_regex.so.1.72.0  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_log.so.1.72.0  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libproxy.so  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_thread.so.1.72.0  -lpthread  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_filesystem.so.1.72.0  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_chrono.so.1.72.0  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_atomic.so.1.72.0  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_date_time.so.1.72.0  /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libboost_regex.so.1.72.0 && :
| /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: client-lite/CMakeFiles/deliveryoptimization-agent.dir/src/exe/docs.cpp.o: undefined reference to symbol 'ERR_reason_error_string@@OPENSSL_1_1_0'
| /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/ld: /build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/recipe-sysroot/usr/lib/libcrypto.so.1.1: error adding symbols: DSO missing from command line
| collect2: error: ld returned 1 exit status
| ninja: build stopped: subcommand failed.
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/deliveryoptimization-agent/1.0+gitAUTOINC+cd2eaadc07-r0/temp/run.do_compile.9472' failed with exit code 1
ERROR: Task (/work/meta-azure-device-update/recipes-azure-device-update/deliveryoptimization-agent/deliveryoptimization-agent_git.bb:do_compile) failed with exit code '1'

从以前的研究中我最好的猜测是我需要将 -lcrypto 作为参数传递给编译器,但我不知道该怎么做。

感谢任何帮助。

【问题讨论】:

  • 您尚未将openssl 添加到DEPENDS
  • 嗨,Oleksandr,我在依赖项中包含了 openssl 并运行了 bitbake -c cleanall deliveryoptimization-agentbitbake deliveryoptimization-agent,但这并没有解决问题。
  • 那么错误的 openssl 版本?
  • poky 提供了 openssl1.1.1l 的配方。我可以指定一个依赖版本吗?如果可以的话,我需要一个单独的 openssl 配方吗?

标签: cmake yocto bitbake


【解决方案1】:

这个问题是由另一个看似不相关的包引起的,它在第一次运行时出现错误,但在重新启动构建过程时会正常构建。解决这个问题也解决了这个问题。

【讨论】:

    猜你喜欢
    • 2017-06-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-28
    相关资源
    最近更新 更多