Skip to content

Disable incremental linking in coreclr Checked Windows builds - #192

Merged
BruceForstall merged 1 commit into
dotnet:masterfrom
BruceForstall:FixIncrementalLinkWarning
Nov 22, 2019
Merged

BruceForstall merged 1 commit into
dotnet:masterfrom
BruceForstall:FixIncrementalLinkWarning

Conversation

@BruceForstall

Copy link
Copy Markdown
Contributor

We force /OPT:REF and this is incompatible with incremental linking
(and yields a warning to that effect). To fix, explicitly disable
incremental linking.

(I couldn't find anyplace where it was explicitly enabled, so I believe
it is enabled by default with the given linker options.)

Another option would be to not force /OPT:REF for Checked builds.

Fixes #191

We force `/OPT:REF` and this is incompatible with incremental linking
(and yields a warning to that effect). To fix, explicitly disable
incremental linking.

(I couldn't find anyplace where it was explicitly enabled, so I believe
it is enabled by default with the given linker options.)

Another option would be to not force `/OPT:REF` for Checked builds.
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the area-Infrastructure-coreclr Only use for closed issues label Nov 21, 2019
@BruceForstall

Copy link
Copy Markdown
Contributor Author

@AaronRobinsonMSFT @dotnet/runtime-infrastructure PTAL

@AaronRobinsonMSFT

Copy link
Copy Markdown
Member

@BruceForstall I don't fully understand why we want this. Having /opt:ref seems like a weird thing to force on CHK builds. I would think the incremental linking is preferred for the dev inner loop.

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is really what is desired, this code looks fine. I would strongly recommend removing /OPT:REF unless there is a compelling scenario where the run time of CoreCLR is more important than a faster inner loop.

@BruceForstall

Copy link
Copy Markdown
Contributor Author

I did what is minimal to fix the warning without changing behavior.

I use Checked builds when running tests, but generally not when debugging (I use Debug for that). Does /OPT:REF make these runs faster or slower? Seems like it shouldn't make much of a difference; it might change the on-disk size some.

@AaronRobinsonMSFT

Copy link
Copy Markdown
Member

/OPT:REF can make the application run faster in some circumstances and is on by default unless /DEBUG is set. I personally don't know how interesting it is to have it and I have always preferred to set /OPT:NOREF so I get incremental build when possible.

I use Checked builds when running tests, but generally not when debugging (I use Debug for that)

Same here. I hear that @jkotas does use CHK a lot so maybe he has a preference - incremental build is always a high priority for me outside of a REL build.

@jkotas

jkotas commented Nov 22, 2019

Copy link
Copy Markdown
Member

@jkotas does use CHK a lot so maybe he has a preference

The non-incremental linking step is fast enough for me.

@BruceForstall
BruceForstall merged commit 3c1dcd2 into dotnet:master Nov 22, 2019
@BruceForstall
BruceForstall deleted the FixIncrementalLinkWarning branch November 22, 2019 06:35
@karelz karelz added this to the 5.0.0 milestone Aug 18, 2020
MichalStrehovsky pushed a commit to MichalStrehovsky/runtime that referenced this pull request Nov 10, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Infrastructure-coreclr Only use for closed issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

coreclr checked build warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:REF' specification

5 participants