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

Remove gcc assumptions from param files for linking #6788

Closed
hlopko opened this issue Nov 28, 2018 · 1 comment
Closed

Remove gcc assumptions from param files for linking #6788

hlopko opened this issue Nov 28, 2018 · 1 comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-CPP Issues for C++ rules type: feature request

Comments

@hlopko
Copy link
Member

hlopko commented Nov 28, 2018

Problem 1

LinkCommandLine parses the command line and removes -Wl, prefix. Flags without the prefix are then written to the params file, and the param file is passed to the compiler as -Wl,@param.file (which skips the compiler handling and is passed verbatim to the linker).

Instead, we should not massage the flags, and pass the param file directly to the compiler as @param.file.

Problem 2

LinkCommandLine parses linkopts and moves -l flags (telling the linker to link against the library) to a different place on the command line than the rest of the linkopts. Because of this, we cannot currently link without the param file, and we hardcode specific gcc flags that we will reshuffle.

This reshuffling shouldn’t happen, and we should be able to link without params files, or by putting whole command line to params file (depending on the command line length).

Result

These two issues, when fixed, will allow us to unify the commandlines with how Starlark does it: Unification of Bazel lazy action args

@hlopko hlopko added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Jan 9, 2019
@oquenchil
Copy link
Contributor

Fixed after #7687 was flipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-CPP Issues for C++ rules type: feature request
Projects
None yet
Development

No branches or pull requests

3 participants