英文:
libssl.so needed by target, missing and no known rule to make it
问题
我正在尝试为一个应用程序(application_1.0.0.bb)创建一个Yocto配方(Yocto recipe)。以下是该应用程序的一个简化的CMake文件:
cmake_minimum_required(VERSION 3.14)
project(
server
VERSION 0.1.0
DESCRIPTION "Main application"
HOMEPAGE_URL "https://gitlab.123.com/software/projects/server"
LANGUAGES CXX
)
message(STATUS "CMAKE_CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# ---- Poco::Util ----
find_package(Poco REQUIRED COMPONENTS Util)
find_package(unofficial-libmariadb CONFIG REQUIRED)
find_package(Poco REQUIRED COMPONENTS Data DataMySQL)
# ---- Declare executable ----
add_executable(server_exe
src/main.cpp
)
add_executable(server::exe ALIAS server_exe)
set_property(TARGET server_exe PROPERTY OUTPUT_NAME server)
target_compile_features(server_exe PRIVATE cxx_std_17)
target_link_libraries(server_exe
PRIVATE
Poco::Util
Poco::DataMySQL
)
Poco和mariadb都在application.bb
配方的DEPENDS
中。它们的CMake过程的重要部分(从原始项目稍作修改)如下:
-
Poco::DataMySQL 使用
target_link_libraries(DataMySQL PUBLIC Poco::Data ${MYSQL_LIBRARIES})
,其中MYSQL_LIBRARIES
设置为unofficial::libmariadb
,而在其之前调用了find_package(unofficial-libmariadb CONFIG REQUIRED)
。Poco库使用了-DBUILD_SHARED_LIBS=OFF
选项进行构建,因此它构建静态库。 -
libmariadb 使用
TARGET_LINK_LIBRARIES(libmariadb LINK_PRIVATE ${SYSTEM_LIBS})
,其中SYSTEM_LIBS
包括SET(SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
,而OPENSSL_SSL_LIBRARY
和OPENSSL_CRYPTO_LIBRARY
是由FIND_PACKAGE(OPENSSL)
定义的变量。libmariadb以unofficial::libmariadb
形式导出。
配置步骤成功,但在编译步骤开始时,bitbake 给出以下错误:
ERROR: application-1.0+gitAUTOINC+ebcaa0785-r0 do_compile: ExecutionError('/home/buildbot/oe-core/build/cortexa53-tdx-linux/application/1.0+gitAUTOINC+ebcaa0785-r0/temp/run.do_compile.368082', 1, None, None)
ERROR: Logfile of failure stored in: ...
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: VERBOSE=1 cmake --build /home/buildbot/oe-core/build/tmp/work/cortexa53-tdx-linux/application/1.0+gitAUTOINC+ebcaa0785-r0/build --target all --
| ninja: error: '/home/buildbot/oe-core/build/tmp/work/cortexa53-tdx-linux/mariadb/10.7.4-r0/recipe-sysroot/usr/lib/libssl.so' needed by 'application', missing and no known rule to make it
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/.../application_1.0.0.bb:do_compile) failed with exit code '1'
这个错误表明编译过程中缺少'/home/buildbot/oe-core/build/tmp/work/cortexa53-tdx-linux/mariadb/10.7.4-r0/recipe-sysroot/usr/lib/libssl.so'
文件,且没有已知的规则生成它。
英文:
I am trying to make a Yocto recipe for an application (application_1.0.0.bb). Here is a (simplified) CMake for that application:
cmake_minimum_required(VERSION 3.14)
project(
server
VERSION 0.1.0
DESCRIPTION "Main application"
HOMEPAGE_URL "https://gitlab.123.com/software/projects/server"
LANGUAGES CXX
)
message(STATUS "CMAKE_CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# ---- Poco::Util ----
find_package(Poco REQUIRED COMPONENTS Util)
find_package(unofficial-libmariadb CONFIG REQUIRED)
find_package(Poco REQUIRED COMPONENTS Data DataMySQL)
# ---- Declare executable ----
add_executable(server_exe
src/main.cpp
)
add_executable(server::exe ALIAS server_exe)
set_property(TARGET server_exe PROPERTY OUTPUT_NAME server)
target_compile_features(server_exe PRIVATE cxx_std_17)
target_link_libraries(server_exe
PRIVATE
Poco::Util
Poco::DataMySQL
)
Both poco and mariadb are in the DEPENDS
of application.bb recipe. The important parts of their CMake process (a bit patched from the original projects) are:
- Poco::DataMySQL has
target_link_libraries(DataMySQL PUBLIC Poco::Data ${MYSQL_LIBRARIES})
withset(MYSQL_LIBRARIES unofficial::libmariadb)
and afind_package(unofficial-libmariadb CONFIG REQUIRED)
called right before. Oh, and the Poco library is built the -DBUILD_SHARED_LIBS=OFF (so it builds static libraries) - libmariadb has a
TARGET_LINK_LIBRARIES(libmariadb LINK_PRIVATE ${SYSTEM_LIBS})
withSYSTEM_LIBS
withSET(SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
(Both OPENSSL_SSL_LIBRARY and OPENSSL_CRYPTO_LIBRARY being variables coming outFIND_PACKAGE(OPENSSL)
). It is exported as unofficial::libmariadb.
Configuration step is successful but at the start of the compile step, bitbake gives me this error:
ERROR: application-1.0+gitAUTOINC+ebcaa0785-r0 do_compile: ExecutionError('/home/buildbot/oe-core/build/cortexa53-tdx-linux/application/1.0+gitAUTOINC+ebcaa0785-r0/temp/run.do_compile.368082', 1, None, None)
ERROR: Logfile of failure stored in: ...
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: VERBOSE=1 cmake --build /home/buildbot/oe-core/build/tmp/work/cortexa53-tdx-linux/application/1.0+gitAUTOINC+ebcaa0785-r0/build --target all --
| ninja: error: '/home/buildbot/oe-core/build/tmp/work/cortexa53-tdx-linux/mariadb/10.7.4-r0/recipe-sysroot/usr/lib/libssl.so' needed by 'application', missing and no known rule to make it
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/.../application_1.0.0.bb:do_compile) failed with exit code '1'
答案1
得分: 0
错误信息表示需要 libssl.so,但它丢失了。您需要在您的 .bbappend 文件中添加构建依赖项(以及可能的运行时依赖项?)
DEPENDS += "openssl"
RDEPENDS += "openssl"
英文:
The error say libssl.so is needed but missing. You need to add in your .bbappend file a build dependency (and maybe runtime dependency?)
DEPENDS += "openssl"
RDEPENDS += "openssl"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论