Bazel cc_shared_library Explained
cc_shared_library is a Bazel rule for building C++ shared libraries (.so/.dll). Unlike the simple cc_binary(linkshared=1), it provides fine-grained dependency management, intelligently deciding which libraries should be statically linked into the shared library and which should be obtained through dynamic dependencies.
This blog provides an in-depth analysis of the cc_shared_library implementation to help you understand its internal workings.