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/