简体   繁体   English

带有 boost 1.77 的 yocto 图像:libboost_atomic.so 不在图像上,但在 sdk 中

[英]yocto image with boost 1.77: libboost_atomic.so is not on image, but is in sdk

I have an aarch64 based yocto image, and it contains also an app that I compile as a package and that app uses and links with boost 1.77 and uses boost::filesystem using cmake.我有一个基于 aarch64 的 yocto 图像,它还包含一个我编译为 package 的应用程序,该应用程序使用并链接到 boost 1.77,并使用 boost::filesystem 使用 cmake。 The app on the image works and everything is ok.图像上的应用程序工作正常,一切正常。

The problem I have is: I also generated the SDK part for yocto, and that SDK contains all boost libraries, also ones that are not on the image, for example libboost_atomic.so.我遇到的问题是:我还为 yocto 生成了 SDK 部分,并且 SDK 包含所有的 boost 库,也包括那些不在图像上的库,例如 libboost_atomic.so。 And when I externally compile my app using the SDK, then it links also to libboost_atomic.so.当我使用 SDK 从外部编译我的应用程序时,它也链接到 libboost_atomic.so。

But of course, it's not on the image, so I can't run it on my device because it does not find the atomic lib at runtime.但当然,它不在图像上,所以我无法在我的设备上运行它,因为它在运行时找不到原子库。 So how should I solve this problem?那么我应该如何解决这个问题呢? The libboost_atomic.so library does not really seem to be needed, but the sdk thinks it does. libboost_atomic.so 库似乎并不需要,但 sdk 认为需要。

I am using yocto Honister.我正在使用 yocto Honister。

You need to add boost to IMAGE_INSTALL .您需要将boost添加到IMAGE_INSTALL Otherwise Yocto will only install the libraries used in components deployed to the image.否则 Yocto 将仅安装部署到映像的组件中使用的库。

I found the problem: for the SDK, I use a cmake toolchain file, and so that file did not contain a linker option that yocto uses: -Wl,--as-needed我发现了问题:对于 SDK,我使用了 cmake 工具链文件,因此该文件不包含 yocedto 使用的-Wl,--as-needed选项:-W

So using that option, the linker is not linking to libboost_atomic.so anymore and I can run my sdk-compiled version on the image!因此,使用该选项,linker 不再链接到 libboost_atomic.so,我可以在图像上运行我的 sdk 编译版本!

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM