Since Ubuntu 26.04, libcrypto and libssl require zlib. According to the OpenSSL manual pages, OpenSSL may be built with or without zlib, depending on a config option. If built with zlib, zlib is required unconditionally. For the latest Ubuntu LTS'es, the following applies:
When a target links to /openssl//ssl and <link>shared is being used, everything works because the dynamic loader takes care of the transitive dependency. When using <link>static, however, the linker complains about undefined zlib symbols.
Adding /zlib//zlib is not an easy solution, because this would require the zlib headers, which are not installed in all CIs (and not really required, because the dependency is only at the binary level).
I'm encountering this problem when linking to /boost/corosio//boost_corosio_openssl, which links to /openssl//ssl (so using /openssl//ssl/<link>shared is not in my hands).
Since CMake's FindOpenSSL handles this, it looks like b2's module could handle this, too. Some solutions that come to my mind:
- Let the user configure in
user-config.jam if /openssl//ssl should always use the dynamic version of the library.
- Conditionally add
-lz to link lines.
Since Ubuntu 26.04, libcrypto and libssl require zlib. According to the OpenSSL manual pages, OpenSSL may be built with or without zlib, depending on a config option. If built with zlib, zlib is required unconditionally. For the latest Ubuntu LTS'es, the following applies:
When a target links to
/openssl//ssland<link>sharedis being used, everything works because the dynamic loader takes care of the transitive dependency. When using<link>static, however, the linker complains about undefined zlib symbols.Adding
/zlib//zlibis not an easy solution, because this would require the zlib headers, which are not installed in all CIs (and not really required, because the dependency is only at the binary level).I'm encountering this problem when linking to
/boost/corosio//boost_corosio_openssl, which links to/openssl//ssl(so using/openssl//ssl/<link>sharedis not in my hands).Since CMake's
FindOpenSSLhandles this, it looks like b2's module could handle this, too. Some solutions that come to my mind:user-config.jamif/openssl//sslshould always use the dynamic version of the library.-lzto link lines.