paho.mqtt.c
paho.mqtt.c copied to clipboard
Fully static builds with musl
I just wanted to point out an interesting new capability that came out of the last release, particularly from the new ability to build just the static library (#792).
Users of the Rust library, which wraps this one, had been complaining that they could not compile using the musl build tools. Musl is a small std C lib that can be statically linked. With the latest Paho C library (and a very minor tweak to the build), we're now able to build Rust apps using musl and Paho C that are fully static; no runtime dependencies on the platform; not even on the standard C lib.
$ ./async_publish
Publishing a message on the 'test' topic
$ ldd async_publish
not a dynamic executable
So, for example, if maintaining a suite of apps for some newer and older embedded Linux boards, the same executables could be deployed without worry about the C ABI on the particular boards.
Certainly C apps using the Paho library could do this also.
See this issue from the Rust lib for more info: https://github.com/eclipse/paho.mqtt.rust/issues/57