BaseTools: Disable Second DLINK step for WHOLEARCHIVE #1243
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Project Mu does not use WHOLEARCHIVE, due to issues in silicon partner code when it is enabled. In order to support WHOLEARCHIVE, edk2 added a second dlink step in the build rules to get the benefit of identifying duplicate symbols without needing the space expansion. This is an extra linking step for each module and so does increase build time. Without WHOLEARCHIVE, this is an unneeded step on Mu, so it is disabled here.
This additional linking step just is a test to verify that there are not duplicate symbols, the actual FW build is not changed here, that is what the second DLINK step does, without the DLINK2_FLAGS where WHOLEARCHIVE is set. HOST_APPLICATIONs still require WHOLEARCHIVE for the actual build, as GoogleTest requires it or could miss some unit tests, due to the complexities of a C++ build in the edk2 build system. UnitTestFrameworkPkgHost.dsc.inc sets this in the DLINK_FLAGS, not DLINK2_FLAGS, so this is still respected.
How This Was Tested
CI build
Integration Instructions
N/A.