Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ck/cherry pick cc shared library (#15754)
* Add regular library in interface_library group of cc_shared_library The regular library was already accessible via the main_shared_library_output group but making it also available in interface_library when there is no actual interface library available is inline with the current behavior of cc_binary. RELNOTES:none PiperOrigin-RevId: 455497044 Change-Id: Ia80fed253e0c79584f23f08eb25b930362e3ff02 * Remove unnecessary file from runfiles of cc_shared_library When a precompilied library appeared in the transitive closure of a cc_shared_library, we would be adding the library itself to runfiles as well as the symlink created in the solib directory. Although harmless, it is unnecessary to add the original library since the symlink in the solib directory will be followed anyway by the Bazel runfiles logic. The behavior now matches that of cc_binary(linkshared=1) The same reasoning can be applied for the main output of a cc_shared_library or a cc_binary(linkshared=1). However, for the latter the logic is written the opposite way, it only adds the library and not the symlink in solib. Unlike cc_binary(linkshared=1), for cc_shared_library we must add the symlink in cc_shared_library because this is what its dependents are linked against. We could just add the symlink in solib and be done since it will in turn pull the original library. However, to keep it more similar to cc_binary(linkshared=1) we add also add the original library, this is documented in this CL with a comment. RELNOTES:none PiperOrigin-RevId: 456074285 Change-Id: Ic383c04569b3d780ca09fc09713bce95c3304636 Co-authored-by: Googler <plf@google.com>
- Loading branch information