How to add a custom toolchain to Leaf?


We are trying to use Leaf to simplify and streamline our dev and build process and we can’t find in the documentation how to add custom libraries and/or includes. We would normally add them to the /opt/swi/[…]/usr/include path and gcc would find them no problem but how would we do this using Leaf? Is there a way to use a custom toolchain and deploy it to a server or something similar? Or could we diff it and only provide the includes/libs we need in a separate component?

I hope this makes sense,
thank you!

Hi @fjanicki,

so far leaf is only wrapping up the toolchain has provided by Yocto, so if you want to do something similar you would need to add the libraries in yocto (nativesdk recipes + add them to toolchain packagegroups such as meta-swi/common/recipes-core/packagegroups/

I’m thinking that you could also create a leaf package that depends on the toolchain that you want, + creates some kind of overlay (maybe using symlinks?) to append the content that you want. However for now I’m not aware of anyone doing anything like that.

Unfortunately our yocto image is provided to us by our hardware vendor/provider, as well as the built legato version, but they provide us with the complete toolchain.

If your vendor doesn’t provide the toolchain sources so you can rebuild it, I guess the only way would be to patch it. I imagine you could do that by taking that toolchain + copying some binaries.

You could eventually use leaf to do that. I’m thinking that if you build a leaf package that:

  • extracts the original toolchain
  • patch/copy some extra content

I’m not sure if you have already that extra content or if you need to build it. If you do need to build it, maybe matching the version that you received to some WP release (source code for that being available), you could build the extra content that way.