commit | f9008f698467eb85657711c608db16086a9908eb | [log] [tgz] |
---|---|---|
author | Googler <plf@google.com> | Wed Mar 08 06:14:04 2023 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Mar 08 06:15:36 2023 -0800 |
tree | 613a04c316be5ae0abbe9bc6d0cc07eb5821e971 | |
parent | 56a9efbacbf6263f80a318b1e402b865d4f6a70b [diff] |
Fix cc_shared_library to take into account indirect top level deps The cc_shared_library implementation wraps its top level direct dependencies in whole archive because otherwise since there aren't any symbols in the shared library depending on them they would be dropped by the linker. There are instances where the target placed in the direct dep of a cc_shared_library doesn't have a linker_input or if it has it, the linker_input may not have any code to be linked statically into the shared library. When that happens, the actual code to be linked is depended on indirectly, e.g. cc_shared_library -> cc_proto_library -> proto_library. Here it is the code generated by the aspect applied on proto_library that should be linked statically. Since this dependency was indirect, that code wasn't whole-archived. Before this fix, we only tried to whole-archive cc_proto_library but the cc_proto_library target itself did not produce any linker_inputs, for this reason the code from the proto_library was dropped by the linker. This CL also adds more test coverage for the dynamic_only_roots failure triggered explicitly by the cc_shared_library implementation. RELNOTES:none PiperOrigin-RevId: 515017649 Change-Id: I022e1cb4f70fa4584893d3c34172236fdf2e5f73
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
To report a security issue, please email security@bazel.build with a description of the issue, the steps you took to create the issue, affected versions, and, if known, mitigations for the issue. Our vulnerability management team will respond within 3 working days of your email. If the issue is confirmed as a vulnerability, we will open a Security Advisory. This project follows a 90 day disclosure timeline.
See CONTRIBUTING.md