Description
This is a tracking issue for link arguments respecting their relative order with -l
library options, which is a part of RFC "Linking modifiers for native libraries" (#81490, rust-lang/rfcs#2951), https://github.com/rust-lang/rfcs/blob/master/text/2951-native-link-modifiers.md#relative-order-of--l-and--clink-args-options specifically.
There's no feature gate for the issue.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
- Implement the RFC - flag '-l link-arg=___ was added #99467
- Adjust documentation (see instructions on rustc-dev-guide)
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
The feature is unlikely to be implementable in the form that is specified in the RFC, i.e. by preserving relative order of -l
and -Clink-arg(s)
options.
-C link-arg
was usable for overriding options previously passed by the compiler for long time, so is pretty much guaranteed to be passed at the end of command line at this point.
The suggested solution (see #81490 and below) is to reuse the -l
option for such arguments and introduce -l link-arg=arbitrary-link-argument
, which is exactly like -C link-arg=arbitrary-link-argument
, except that its relative order to other -l
options is respected.