Fix cc_common.link runtime library selection - #4225
Open
KirillTim wants to merge 1 commit into
Open
Conversation
## Summary - honor `--dynamic_mode=fully` when calling `cc_common.link` - add Starlark analysis tests for runtime selection and shared `link_deps` - compare Rust linkage behavior with equivalent `cc_binary` targets ## Why `cc_common.link` defaults `link_deps_statically` to true. Rust targets therefore selected the static C++ runtime even under fully dynamic linking. ## Impact Rust targets using `cc_common.link` now select the dynamic C++ runtime when built with `--dynamic_mode=fully`, matching `cc_binary` behavior. ## Validation ``` $bazel test //... ... Executed 578 out of 608 tests: 578 tests pass and 30 were skipped. ``` This is a follow-up to 226c488
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--dynamic_mode=fullywhen callingcc_common.linklink_depscc_binarytargetsWhy
cc_common.linkdefaultslink_deps_staticallyto true. Rust targets therefore selected the static C++ runtime even under fully dynamic linking.Impact
Rust targets using
cc_common.linknow select the dynamic C++ runtime when built with--dynamic_mode=fully, matchingcc_binarybehavior.Validation
This is a follow-up to 226c488