Yocto&生锈 - 食谱无法生成正确的构建依赖性

发布于 2025-01-30 14:27:14 字数 1597 浏览 5 评论 0原文

我正在尝试构建 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

  1. libncurses.so.5& 被填充到同一目录(copipe-sysroot/lib/copipe-sysroot/usr/lib/code>)
  2. 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

  1. libncurses.so.5 & libclang.so are populated to the same directory (either recipe-sysroot/lib/or recipe-sysroot/usr/lib/)
  2. The dependencies for libclang.so search in recipe-sysroot/lib/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

森林散布 2025-02-06 14:27:14

我的最终解决方案涉及在配置步骤中手动创建指向所需库的链接。下面的代码检查{workDir}/usr/lib目录中是否存在require库,如果不是,则为{WorkDir}/lib 目录。

DEPENDS += " clang ncurses libsdl2"

USR_LIB_WORKDIR = "${WORKDIR}/recipe-sysroot/${libdir}"
BASE_LIB_WORKDIR = "${WORKDIR}/recipe-sysroot/${base_libdir}"
export LIBCLANG_PATH = "${USR_LIB_WORKDIR}"

do_configure:append() {
    if [ -f ${USR_LIB_WORKDIR}/libncurses.so.5 ];
    then
      echo "libncurses.so.5 already exists"
    else
        ln -s ${BASE_LIB_WORKDIR}/libncurses.so.5 ${USR_LIB_WORKDIR}/libncurses.so.5
    fi

    if [ -f ${USR_LIB_WORKDIR}/libtinfo.so.5 ];
    then
      echo "libtinfo.so.5 already exists"
    else
        ln -s ${BASE_LIB_WORKDIR}/libtinfo.so.5 ${USR_LIB_WORKDIR}/libtinfo.so.5
    fi
}

我相信可以通过提取测试来改进配方&将上面的链接操作创建到一个单独的函数中,但目前我不确定如何创建/调用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.

DEPENDS += " clang ncurses libsdl2"

USR_LIB_WORKDIR = "${WORKDIR}/recipe-sysroot/${libdir}"
BASE_LIB_WORKDIR = "${WORKDIR}/recipe-sysroot/${base_libdir}"
export LIBCLANG_PATH = "${USR_LIB_WORKDIR}"

do_configure:append() {
    if [ -f ${USR_LIB_WORKDIR}/libncurses.so.5 ];
    then
      echo "libncurses.so.5 already exists"
    else
        ln -s ${BASE_LIB_WORKDIR}/libncurses.so.5 ${USR_LIB_WORKDIR}/libncurses.so.5
    fi

    if [ -f ${USR_LIB_WORKDIR}/libtinfo.so.5 ];
    then
      echo "libtinfo.so.5 already exists"
    else
        ln -s ${BASE_LIB_WORKDIR}/libtinfo.so.5 ${USR_LIB_WORKDIR}/libtinfo.so.5
    fi
}

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文