Remove gcc assumptions from param files for linking #6788
Labels
P2
We'll consider working on this in future. (Assignee optional)
team-Rules-CPP
Issues for C++ rules
type: feature request
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
The text was updated successfully, but these errors were encountered: