fix(build): add missing picotls dependencies for static linking#25
fix(build): add missing picotls dependencies for static linking#25mmokhi wants to merge 1 commit intoEndPositive:mainfrom
Conversation
When building with -Ddefault_library=static, the linker fails with undefined references to ptls_* symbols (e.g., ptls_free, ptls_aead_new). It seems that Meson's CMake integration does not propagate transitive dependencies, so we seem to have to make it explicit.
|
this doesn't seem to build on my machine anymore, see: can you make sure the docker image succeeds the build? also I'm not sure exactly why you need this, so a little extra explanation would be nice :) |
|
The static link failure comes from how find_library(PTLS_CORE_LIBRARY picotls-core HINTS ${PTLS_HINTS})
find_library(PTLS_OPENSSL_LIBRARY picotls-openssl HINTS ${PTLS_HINTS})
find_library(PTLS_FUSION_LIBRARY picotls-fusion HINTS ${PTLS_HINTS})
find_library(PTLS_MINICRYPTO_LIBRARY picotls-minicrypto HINTS ${PTLS_HINTS})
set(PTLS_LIBRARIES
${PTLS_CORE_LIBRARY}
${PTLS_OPENSSL_LIBRARY}
${PTLS_FUSION_LIBRARY}
${PTLS_MINICRYPTO_LIBRARY})These variables are things like |
The exaplanations from @ImanSeyed is rather more complete than all I could say 😄 but if I want to add more context: Since docker image was not starting up well (the server binary would just coredump due to a thread problem) , I investigated this further and noticed it's due to mismatch with (not-)linked libraries and when tried to build the static binary I had linking errors. |
|
@EndPositive I just tried to build the docker image (on my branch), using a simple Do you happen to use any flags in particular that I should use while building? (I use |
When building with -Ddefault_library=static, the linker fails with undefined references to ptls_* symbols (e.g., ptls_free, ptls_aead_new).
It seems that Meson's CMake integration does not propagate transitive dependencies, so we seem to have to make it explicit.