MySQL source distribution contains sources for zlib (compression library), YaSSL (ssl library), readline and libedit. MySQL can be compiled using either libraries available on the system or, to minimize external dependencies, with bundled sources. For Unix/Linux packagers, using system libraries is a more natural option and CMake build has support for it, using options below
-DWITH_ZLIB=system (link with system libz.so)
-DWITH_SSL=system (link with system libssl.so, libcrypto.so)
-DWITH_READLINE=system (link with system libreadline.so)
On Linux, --Wl,--as-needed link option can also be used to remove unused dependencies. While CMake build tries to avoid unneeded dependencies, --as-needed brings better results, for example it removes unused dependency on libgcc_s.so
--Wl,--no-undefined can *not* be used at the moment if plugins are built, because plugins have direct dependency (use symbols) exported by MySQL server.