gpt4 book ai didi

c++ - bitbake grpc 交叉编译/配置失败,出现错误 c-ares::cares 引用文件/usr/lib/libcares.so.2.2.0

转载 作者:行者123 更新时间:2023-11-28 04:36:05 26 4
gpt4 key购买 nike

在 open-embedded 中构建 grpc 时,我在查找 c-ares 依赖项时遇到问题。在配置期间查找依赖项 c-ares 时,日志中的错误在日志中显示为 -

--

Found ZLIB: ....../poky/build/tmp-glibc/sysroots/arm7/usr/lib/libz.so (found version "1.2.8")
CMake Error at ....../poky/build/tmp-glibc/sysroots/arm7/usr/lib/cmake/c-ares/c-ares-targets.cmake:70 (message):
The imported target "c-ares::cares" references the file
"/usr/lib/libcares.so.2.2.0"

but this file does not exist. Possible reasons include:

* The file was deleted, renamed, or moved to another location.

* An install or uninstall procedure did not complete successfully.

* The installation package was faulty and contained

"/home/...../poky/build/tmp-glibc/sysroots/arm7/usr/lib/cmake/c-ares/c-ares-targets.cmake"
but not all the files it references.

--

问题似乎是 cmake 如何为 c-ares 配置导入前缀,它在文件中配置如下 - poky/build/tmp-glibc/sysroots/arm7/usr/lib/cmake/c-ares/c -ares-targets.cmake。我相信它应该是进入目标暂存目录的路径

设置(_IMPORT_PREFIX "/usr")

有人可以帮我找出这里的问题吗?需要在 c-ares 配方中配置什么才能使 _IMPORT_PREFIX 正确?任何帮助深表感谢。谢谢

最佳答案

我今天在旧的(daisy)BitBake 环境中构建新的 gRPC 时遇到了这个问题。我找到的解决方案是向后移植 this upstream change to the cmake.bbclass或者通过 EXTRA_OECMAKE 变量修改 .bbappend 中更新的变量定义到 cmake 调用。

我选择了后者,因为我似乎只是为了 c-ares 才需要它,并且想限制我的影响。我最终没有深入研究 c-ares 和其他 gRPC 依赖项(例如 gflags)如何生成 CMake 导出目标文件之间的区别。我假设最终目标路径是通过某种方式在各个项目的 CMakeLists.txt 文件中生成的。

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index b18152a8ed..5203d8aca1 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -108,15 +108,15 @@ cmake_do_configure() {
${OECMAKE_SITEFILE} \
${OECMAKE_SOURCEPATH} \
-DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
- -DCMAKE_INSTALL_BINDIR:PATH=${bindir} \
- -DCMAKE_INSTALL_SBINDIR:PATH=${sbindir} \
- -DCMAKE_INSTALL_LIBEXECDIR:PATH=${libexecdir} \
+ -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir', True), d.getVar('prefix', True))} \
+ -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir', True), d.getVar('prefix', True))} \
+ -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir', True), d.getVar('prefix', True))} \
-DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
- -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${sharedstatedir} \
+ -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir', True), d. getVar('prefix', True))} \
-DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
- -DCMAKE_INSTALL_LIBDIR:PATH=${libdir} \
- -DCMAKE_INSTALL_INCLUDEDIR:PATH=${includedir} \
- -DCMAKE_INSTALL_DATAROOTDIR:PATH=${datadir} \
+ -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir', True), d.getVar('prefix', True))} \
+ -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir', True), d.getVar('prefix', True))} \
+ -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir', True), d.getVar('prefix', True))} \
-DCMAKE_INSTALL_SO_NO_EXE=0 \
-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
-DCMAKE_VERBOSE_MAKEFILE=1 \

关于c++ - bitbake grpc 交叉编译/配置失败,出现错误 c-ares::cares 引用文件/usr/lib/libcares.so.2.2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51407735/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com