简体   繁体   English

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

[英]bitbake grpc cross compile/configure failing with error c-ares::cares references the file /usr/lib/libcares.so.2.2.0

I am having issues with finding c-ares dependencies when building grpc in open-embedded.Error in the log when looking for the dependency c-ares during configure is shown in the log as - 我在开放式嵌入式中构建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.

-- -

Issue seem to be how cmake has configured the import prefix for c-ares,which is configured as below in file - poky/build/tmp-glibc/sysroots/arm7/usr/lib/cmake/c-ares/c-ares-targets.cmake. 问题似乎是cmake如何配置c-ares的导入前缀,其在文件中的配置如下-poky / build / tmp-glibc / sysroots / arm7 / usr / lib / cmake / c-ares / c-ares- targets.cmake。 I believe it should be the path into the target staging directory 我相信它应该是目标登台目录的路径

set(_IMPORT_PREFIX "/usr") 设置(_IMPORT_PREFIX“ / usr”)

Can someone please help me identify the issue here? 有人可以帮我在这里找到问题吗? what needs to be configured in the c-ares recipe in order to get the _IMPORT_PREFIX right?? 为了正确使用_IMPORT_PREFIX,需要在c-ares配方中配置什么? Any help is much appreciated. 任何帮助深表感谢。 Thanks 谢谢

I came across this issue today when building a newer gRPC in an older (daisy) BitBake environment. 我今天在较旧的(雏菊)BitBake环境中构建较新的gRPC时遇到了此问题。 The solutions I came to were either backporting this upstream change to the cmake.bbclass or hacking in the updated variable definitions in a .bbappend to the cmake invocation by way of the EXTRA_OECMAKE variable. 我来到的解决方案要么是将此上游更改反向移植到cmake.bbclass,要么是通过EXTRA_OECMAKE变量将.bb附录中的更新变量定义修改为cmake调用。

I chose the latter, as I only seemed to need this for c-ares, and wanted to limit my impact. 我选择了后者,因为我似乎只需要C-ares,并希望限制我的影响。 I did not end up digging into the difference between how c-ares and other gRPC dependencies (eg gflags) generate CMake export targets files. 我最终并没有研究c-ares和其他gRPC依赖项(例如gflags)如何生成CMake导出目标文件之间的区别。 I assume there's some way the ultimate target paths are generated within the respective projects' CMakeLists.txt files. 我假设有某种方法可以在各个项目的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 \

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 安装gRPC:ld:警告:找不到选项&#39;-L /的目录 <path> / GRPC /库/选择/ C-顷 - Installing gRPC : ld: warning: directory not found for option '-L/<path>/grpc/libs/opt/c-ares' 如何在c-ares中获取DNS服务器 - how to get DNS server in c-ares c-ares指定DNS解析的网络接口 - c-ares specifying network interface for the DNS resolves 如何使用c-ares将IP解析为主机? - How do I resolve an IP into host using c-ares? C ++:错误:opencv_core:即使所需的.so文件位于/ usr / lib /中,也没有此类文件或目录 - C++: error: opencv_core: No such file or directory even if the needed .so file is in /usr/lib/ 使用 cmake 交叉编译 grpc - Cross Compile grpc with cmake 如何编译mariadb以获得libmysqlclient.so? (在/ usr / local / mysql / lib中缺少libmysqlclient.so) - how to compile mariadb to get libmysqlclient.so? (missing libmysqlclient.so in /usr/local/mysql/lib) [unixODBC][驱动程序管理器]无法打开 lib &#39;/usr/lib/libmyodbc.so&#39; : 文件未找到但文件存在 - [unixODBC][Driver Manager]Can't open lib '/usr/lib/libmyodbc.so' : file not found but file exist 尝试使用 cpp.so lib 和 extern "C" {... } 段编译 c 代码 - Trying to compile c code with cpp .so lib, with extern "C" { ... } segment gcc - / usr / bin / ld错误:找不到 <library> 在/ usr / local / lib中虽然ldconfig列出它,并且路径已添加到ld.so.conf中 - gcc - /usr/bin/ld error: cannot find <library> in /usr/local/lib though ldconfig list it, and path added to ld.so.conf
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM