I am having trouble figuring out how to use libsodium on an embedded Petalinux device (specifically an Arty-Z7-10).
I followed the instructions under "Build a Recipe from meta-example with PetaLinux Tools" in this webpage to add "libsodium" to the relevant build files. When I built the project, I saw compile messages containing "libsodium" (seemingly using the recipe at /opt/pkg/petalinux/components/yocto/source/arm/layers/meta-oe/recipes-support/libsodium/libsodium_1.0.11.bb
). I verified that the embedded device contained a libsodium library, but it does not contain the library headers.
However, I am not sure how to include and use the library in Petalinux. Directly writing #include <sodium.h>
resulted in compilation errors due to the compiler not being able to find the headers. The build process seemed to ignore any libsodium project I created with petalinux-create -t apps -n libsodium
, making it impossible to bundle my own version instead of using the system recipe. How do I include and use the library on Petalinux?
If you want to set this up on a local environment the basis of the code comes from https://github.com/mitre-cyber-academy/2019-ectf-insecure-example, and I am trying to #include <sodium.h>
in the Arty-Z7-10/components/ext_sources/u-boot-ectf/common/mesh.c
file.