Skip to content

C shared libraries depend on libstdc++ #6221

@brown

Description

@brown

Description of the problem / feature request:

When I build C shard libraries, they end up having a dependency on libstdg++.so.6.
I have not figured out a way to remove this dependency.

Feature requests: what underlying problem are you trying to solve with this feature?

I want to build a shard library from C code that does not depend on libstdc++.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Create a C library with Bazel's cc_binary rule. Set linkshard = True in the BUILD file. Run ldd
on the created shared object. You'll see is has a dependency on libstdc++.so.6.

What operating system are you running Bazel on?

Linux.

What's the output of bazel info release?

development version
It's 0.15.0 with a couple of patches.

Any other information, logs, or outputs that you want to share?

Go folks have worked around this problem
bazel-contrib/rules_go#1681

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4This is either out of scope or we don't have bandwidth to review a PR. (No assignee)not staleIssues or PRs that are inactive but not considered staleteam-Rules-CPPIssues for C++ rulestype: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions