voipmonitor / sniffer

VoIPmonitor sniffer sources
227 stars 105 forks source link

Build Script #50

Closed lancethepants closed 6 years ago

lancethepants commented 6 years ago

Some time ago I successfully compiled v17.0 static binary. I'm not sure if it's something with my setup, or with later versions of voipmonitor that cause static binaries to "abort", while dynamically linked binaries work fine. Could you provide the build scripts you use to create the static binaries you distribute on your website? Since you are creating static binaries, are you using uclibc or musl?

voipmonitor commented 6 years ago

Hi, we are using make static in our Makefile. If it fails you have missing some libraries.

lancethepants commented 6 years ago

Awesome, what can you tell me about your build environment os? Using Debian or Alpine or something different?

voipmonitor commented 6 years ago

debian 8. But most libraries are compiled by hand (gnutls and some others). Where it is failing in your build?

lancethepants commented 6 years ago

ok, to get it to compile I had to surround all the library flags with -Wl,--whole-archive & -Wl,--no-whole-archive.

For some reason on my (admittedly non-conventional) system, it will compile a static binary, but it seems that not all the libraries are getting linked in that are needed, so it aborts or segfaults.

The static library list in the makefile is definitely non-comprehensive, so when I add those flags above, it will tell me which symbols are missing until I get all the libraries needed in there. Afterwards I can strip the binary to reduce size, and it still works. I can compile 21.5. but after that fts_read was added in commit 9cf10ff18dd4b1d3810244730a2638018981fff3, so I'll need to compile uclibc-ng (my c-library) to include it, which will be easy to do.