[Buildroot] cargo package build with dbus dependencie

Patrick G. pgeiem at protonmail.com
Fri Nov 12 09:43:29 UTC 2021


Dear all,

I would like to build a rust application that use rust dbus crate. This application is building fine on native, I am now trying to add it to buildroot to cross-compile it. I am following buildroot user guide for cargo package (§18.16) and it works fine until I use the dbus crate.

When building, cargo try to compile libdbus-sys which require libdbus-1 and return the following error:

  Install a sysroot for the target platform and configure it via
  PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a
  cross-compiling wrapper for pkg-config and set it via
  PKG_CONFIG environment variable.

I added PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH to point to output/build/dbus-1.12.20 where the dbus-1.pc file is.

It now build but I get a lot of linking error for "undefined reference to dbus_..." functions.

Note I have also tried to add the following without success:
  DEPENDENCIES = host-rustc host-pkgconf dbus

Do you have any idea how to solve this ? Is there any recomended way to manage this kind of dependencies ?

Thanks in advance
Patrick



More information about the buildroot mailing list