Thread overview | |||||
---|---|---|---|---|---|
|
August 20, 2019 What's the difference between DMD's `-preview` and `-transition`? | ||||
---|---|---|---|---|
| ||||
I'm planning a PR to fix https://issues.dlang.org/show_bug.cgi?id=6952. The problem, as documented in issue report, is that DMD currently prepends `-Xlinker` to any `-L` command-line arguments (e.g `dmd -L-static` invokes gcc as `gcc -Xlinker -static`). This means that it is impossible to pass certain gcc-specific arguments such as `-static`, `-nodefaultlibs`, `-nostartfiles`, etc. directly to `gcc`. We need to be able to invoke gcc as `gcc -static`, not `gcc -Xlinker - static`). By modifying the current behavior to no longer prepend `-Xlinker` to `-L` command-line arguments, users will be able pass arguments directly to gcc (e.g. `dmd -L-static`) or simulate the current behavior by explicitly appending `-Xlinker` themselves (e.g. `dmd -L-Xlinker -L-T=script.ld`). Both classes of users will have what they need. Unfortunately, changing the current behavior could break build scripts that rely on `-Xlinker` being prepended to any `-L` command-line argument, so I need some way for users to opt-in to the new behavior while allowing a path forward to, someday, deprecate the current behavior. For the scenario described above, should I add a `-preview=fixLinkerInvocation` or a `-transition=fixLinkerInvocation` option? Thanks for the help. Mike |
August 19, 2019 Re: What's the difference between DMD's `-preview` and `-transition`? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Franklin | -transition is the old way. The new way is: -preview=Feature means enable Feature to try it out before it becomes the default. -revert=Feature means disable Feature that has become the default, because your code is not ready yet for Feature. |
August 20, 2019 Re: What's the difference between DMD's `-preview` and `-transition`? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Franklin | On Tuesday, 20 August 2019 at 05:33:44 UTC, Mike Franklin wrote:
> I'm planning a PR to fix https://issues.dlang.org/show_bug.cgi?id=6952.
>
> The problem, as documented in issue report, is that DMD currently prepends `-Xlinker` to any `-L` command-line arguments (e.g `dmd -L-static` invokes gcc as `gcc -Xlinker -static`). This means that it is impossible to pass certain gcc-specific arguments such as `-static`, `-nodefaultlibs`, `-nostartfiles`, etc. directly to `gcc`. We need to be able to invoke gcc as `gcc -static`, not `gcc -Xlinker - static`).
>
> By modifying the current behavior to no longer prepend `-Xlinker` to `-L` command-line arguments, users will be able pass arguments directly to gcc (e.g. `dmd -L-static`) or simulate the current behavior by explicitly appending `-Xlinker` themselves (e.g. `dmd -L-Xlinker -L-T=script.ld`). Both classes of users will have what they need.
>
> Unfortunately, changing the current behavior could break build scripts that rely on `-Xlinker` being prepended to any `-L` command-line argument, so I need some way for users to opt-in to the new behavior while allowing a path forward to, someday, deprecate the current behavior.
>
> For the scenario described above, should I add a `-preview=fixLinkerInvocation` or a `-transition=fixLinkerInvocation` option?
>
> Thanks for the help.
>
> Mike
-preview: enable new features or deprecations
-transition: print _verbose_ debug info e.g. which code lines need to be fixed. Examples:
- tls: list of all variables in TLS
- vmarkdown: list of all instances of markdown replacement
- field: list of all non-mutable fields in an object instance
...
tl;dr: go with -preview=fixLinkerInvocation
|
Copyright © 1999-2021 by the D Language Foundation