Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add nolinkopts for cc_{binary,test} #9238

Closed
lizan opened this issue Aug 23, 2019 · 1 comment
Closed

Feature request: add nolinkopts for cc_{binary,test} #9238

lizan opened this issue Aug 23, 2019 · 1 comment
Labels
team-Rules-CPP Issues for C++ rules untriaged

Comments

@lizan
Copy link

lizan commented Aug 23, 2019

Description of the problem / feature request:

Specifically, I want to remove -lstdc++/-lc++ from generated toolchain for specific target to link libstdc++ statically while keep other cc targets linked dynamically, there's no -static-libc++ but -static-libstdc++. Passing both -lc++ and -l:libc++.a results a dynamic link.

@aiuto aiuto added team-Rules-CPP Issues for C++ rules untriaged labels Aug 25, 2019
@scentini
Copy link
Contributor

scentini commented Sep 4, 2019

There's no plan to add nolinkopts to Bazel, in fact, the next release will not have nocopts as well: #8706.

Bazel has a BAZEL_LINKOPTS variable, which defaults to -lstdc++:-lm, and which you can change to remove -lstdc++. Then, you'll need to add -lstdc++ to linkopts of the targets where you want libstdc++ linked dynamically, and -l:libc++.a for the other ones.

@scentini scentini closed this as completed Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Rules-CPP Issues for C++ rules untriaged
Projects
None yet
Development

No branches or pull requests

3 participants