bazelbuild / bazelbuild/rules_cc

"link_extra_lib" does not have any effect if "linkshared = True" on cc_binary

Open
#349 2 comments 0 reactions 0 assignees View on GitHub
P4
Dominant language
Starlark
Stars
247
Forks
196
PR merge metrics
No merged PRs in 30d

Description

I'm trying to use `link_extra_lib` to link against my C++ runtime environment (a cc_library containing my custom libstdc++.so). This works for regular cc_binaries and cc_tests. However, it does not work for shared libraries, i.e. cc_binary with link_shared=True.

It appears it might be due to this code:

https://github.com/bazelbuild/rules_cc/blob/main/cc/cc_binary.bzl#L36

It's however unclear why this restriction applies. Could this be clarified/fixed?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.