Skip to content

Fix cc_common.link runtime library selection - #4225

Open
KirillTim wants to merge 1 commit into
bazelbuild:mainfrom
KirillTim:try_to_fix_cc_common_link
Open

Fix cc_common.link runtime library selection#4225
KirillTim wants to merge 1 commit into
bazelbuild:mainfrom
KirillTim:try_to_fix_cc_common_link

Conversation

@KirillTim

Copy link
Copy Markdown

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

## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant