Yocto&生锈 - 食谱无法生成正确的构建依赖性
我正在尝试构建 rust yocto ,它使用许多 bindgen 生成的绑定到自定义ioctl
调用。我的食谱包括以下依赖性行:
DEPENDS += " clang ncurses ncurses-native libsdl2"
export LIBCLANG_PATH = "${WORKDIR}/recipe-sysroot/${libdir}"
当我尝试使用bitbake
构建配方时,我会收到以下错误:
| thread 'main' panicked at 'Unable to find libclang: "the `libclang`
shared library at
${WORKDIR}/tmp/work/corei7-64-poky-linux/dummy-reader-sdl2/
0.1.0.AUTOINC+d2766c10a0-r0/recipe-sysroot/
usr/lib/libclang.so.14.0.3 could not be opened:
libncurses.so.5: cannot open shared object file: No such file or directory"',
${WORKDIR}/tmp/work/corei7-64-poky-linux/dummy-reader-sdl2/
0.1.0.AUTOINC+d2766c10a0-r0/
cargo_home/bitbake/bindgen-0.59.2/src/lib.rs:2144:31
当我查看copipe-sysroot/usr/lib/lib/code>时。我可以看到它填充了
lib clang.so
,但libncurses.so.5
缺少(有一个libncurses.so
library) 。
进一步的搜索表明,codipe-sysroot/lib/code>中存在缺失的
libncurses.so.5
。如果我手动添加链接(即ln -s ../../lib/libncurses.so.so.5 libncurses.so.5
我可以重新运行 bitbake and strong>和 应用程序构建并在目标硬件上运行。
通过 /code>
我如何配置我的食谱:
libclang.so
libncurses.so.5
& 被填充到同一目录(copipe-sysroot/lib/
或copipe-sysroot/usr/lib/code>)
libclang的依赖项。因此
搜索>食谱 - 缝线/lib/
I am trying to build a Rust application for Yocto which uses a number of bindgen generated bindings to custom ioctl
calls. My recipe includes the following dependency line:
DEPENDS += " clang ncurses ncurses-native libsdl2"
export LIBCLANG_PATH = "${WORKDIR}/recipe-sysroot/${libdir}"
When I try to build the recipe with bitbake
I get the following error:
| thread 'main' panicked at 'Unable to find libclang: "the `libclang`
shared library at
${WORKDIR}/tmp/work/corei7-64-poky-linux/dummy-reader-sdl2/
0.1.0.AUTOINC+d2766c10a0-r0/recipe-sysroot/
usr/lib/libclang.so.14.0.3 could not be opened:
libncurses.so.5: cannot open shared object file: No such file or directory"',
${WORKDIR}/tmp/work/corei7-64-poky-linux/dummy-reader-sdl2/
0.1.0.AUTOINC+d2766c10a0-r0/
cargo_home/bitbake/bindgen-0.59.2/src/lib.rs:2144:31
When I look in the recipe-sysroot/usr/lib/
I can see that it is populated with lib clang.so
but libncurses.so.5
is missing (there is a libncurses.so
library).
Further searching revealed that the missing libncurses.so.5
is present in recipe-sysroot/lib/
. If I manually add a link (i.e. ln -s ../../lib/libncurses.so.5 libncurses.so.5
I can re-run bitbake and by application builds correctly and runs on the target hardware. This is obviously a hack and I need to find a proper solution.
Note. recipe-sysroot/lib/
does not contain libclang.so
How do I configure my recipe so that either:
libclang.so
libncurses.so.5
&libclang.so
are populated to the same directory (eitherrecipe-sysroot/lib/
orrecipe-sysroot/usr/lib/
)- The dependencies for
libclang.so
search inrecipe-sysroot/lib/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的最终解决方案涉及在配置步骤中手动创建指向所需库的链接。下面的代码检查
{workDir}/usr/lib
目录中是否存在require库,如果不是,则为{WorkDir}/lib 目录。
我相信可以通过提取测试来改进配方&将上面的链接操作创建到一个单独的函数中,但目前我不确定如何创建/调用Yocto配方中的参数。
My eventual solution involves manually creating links to the required libraries within the configure step of the recipe. The code below checks if the require library exists in the
{WORKDIR}/usr/lib
directory, if not it creates a symbolic link to the version in the{WORKDIR}/lib
directory.I am sure the recipe could be improved by extracting the test & create link operation above into a separate function but at present I am unsure how to create/call functions that take parameters in Yocto recipes.