[英]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.