stubby icon indicating copy to clipboard operation
stubby copied to clipboard

Instructions for Static Compilation?

Open owenthewizard opened this issue 6 years ago • 2 comments

owenthewizard avatar Apr 18 '20 01:04 owenthewizard

I have compiled this statically on Alpine by:

  1. Manually downloading and compiling yaml (static libraries only)
  2. Installing openssl-libs-static
  3. Compiling stubby, passing -DOPENSSL_CRYPTO_LIBRARY=/usr/lib/libcrypto.a -DOPENSSL_SSL_LIBRARY=/usr/lib/libssl.a -DCMAKE_EXE_LINKER_FLAGS=-static to CMake.

This gets me a completely static binary, with musl. Omit -DCMAKE_EXE_LINKER_FLAGS=-static for static openssl and libyaml but dynamic libc.

An example Dockerfile to build static stubby is attached.

owenthewizard avatar Apr 21 '20 16:04 owenthewizard

Oops, forgot to attach the Dockerfile. Attached to this comment now. This is just the builder. SHA256SUMS.txt Dockerfile.txt

owenthewizard avatar Apr 22 '20 04:04 owenthewizard