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

Ensure command line linkopts are added to cgo link flags #2926

Merged
merged 1 commit into from
Aug 21, 2021

Conversation

chancila
Copy link
Contributor

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

the cgo flag collection logic does not account for --linkopt configuration flag set for rules_cc. These flags are appended post-toolchain flags in bazel and are not expanded as part of the toolchain logic.

this PR appends these flags (accessible via the cpp fragment) to the options for the executable and shared library linking options.

Which issues(s) does this PR fix?

Fixes #2923

Other notes for review

rules_go seems to be ignoring --linkopt (and --copt/--cxxopt) when
resolving command line flags.

These flags are accessible through the "cpp" fragment and are not
expanded by get_memory_inefficient_command_line as they are not part
of the toolchain.
@steeve steeve merged commit 1f156d8 into bazel-contrib:master Aug 21, 2021
@steeve
Copy link
Contributor

steeve commented Aug 21, 2021

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C++ flags set through command line configuration are ignored by rules_go cgo logic
2 participants