-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CHERRY-PICK] VS22 linker changes from edk2 [Rebase & FF] #1284
Merged
makubacki
merged 3 commits into
microsoft:dev/202405
from
makubacki:cp_hiidb_lnk_changes_2405
Mar 3, 2025
Merged
[CHERRY-PICK] VS22 linker changes from edk2 [Rebase & FF] #1284
makubacki
merged 3 commits into
microsoft:dev/202405
from
makubacki:cp_hiidb_lnk_changes_2405
Mar 3, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev/202405 #1284 +/- ##
==============================================
- Coverage 1.60% 1.60% -0.01%
==============================================
Files 1383 1383
Lines 359859 359864 +5
Branches 5524 5524
==============================================
Hits 5760 5760
- Misses 353992 353997 +5
Partials 107 107
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
os-d
approved these changes
Feb 26, 2025
1bbd3c2
to
796aece
Compare
Javagedes
approved these changes
Mar 3, 2025
Struct assignments are not permitted in EDK2, as they may be converted by the compiler into calls to the 'memcpy' intrinsic, which is not guaranteed to be available in EDK2. So replace the assignment with a call to CopyMem (), and -while at it- replace the loop with a single CopyMem () call, as the loop operates on items that are contiguous in memory. Signed-off-by: Ard Biesheuvel <[email protected]> (cherry picked from commit de4cc40)
Prevent an issue where `memcpy()` instrinsic is being used after recent MSVC linker update in windows-2022 VM image from 14.31.31103 to 14.32.31326. Signed-off-by: Michael Kubacki <[email protected]> (cherry picked from commit 29f02d0161bc5d10a6e3b2cfc4d10799644964a5)
…ailure After updating between various VS2022 versions such as 17.4 to 17.5, , linker failures began to appear in several modules because `memset` is an unresolved symbol. The following functions in BaseMemoryLib/MemLibGeneric.c have their loop pattern replaced with the `memset` intrinsic function: - `InternalMemSetMem16()` - `InternalMemSetMem32()` - `InternalMemSetMem64()` An example of an error related to `InternalMemSetMem64()` in VariableSmmRuntimeDxe is shown below: ``` INFO - BaseMemoryLib.lib(MemLibGeneric.obj) : error LNK2001: unresolved external symbol memset INFO - <...>\VariableSmmRuntimeDxe.dll : fatal error LNK1120: 1 unresolved externals ``` This was reproduced in several environments including: - Public VM image: https://github.com/actions/runner-images/blob/win22/20230226.1/images/win/Windows2022-Readme.md - Locally when updating from 17.4.4 to 17.5.1 > Note: This image (with 17.4) does not have this issue https://github.com/actions/runner-images/blob/win22/20230219.1/images/win/Windows2022-Readme.md This change updates the type cast for the destination buffer to be a pointer to `volatile` data to prevent this optimization with a relatively minimum delta to prior implementation. Signed-off-by: Michael Kubacki <[email protected]> (cherry picked from commit c46bc0ea98b4a8483c970e2282ea46891ea94f57)
796aece
to
4150657
Compare
apop5
approved these changes
Mar 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
impact:non-functional
Does not have a functional impact
type:backport
Backport changes in a dev branch PR to its release branch.
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
Cherry picks a commit upstreamed (reworked from Mu original) and a similar commit made upstream to eliminate Mu delta.
[NEW] MdeModulePkg/HiiDatabaseDxe: Avoid struct assignment
Struct assignments are not permitted in EDK2, as they may be converted
by the compiler into calls to the 'memcpy' intrinsic, which is not
guaranteed to be available in EDK2.
So replace the assignment with a call to CopyMem (), and -while at it-
replace the loop with a single CopyMem () call, as the loop operates on
items that are contiguous in memory.
[NON-FUNCTIONAL REFACTOR] MdeModulePkg/HiiDatabaseDxe: Prevent linker error
Prevent an issue where
memcpy()
instrinsic is being used afterrecent MSVC linker update in windows-2022 VM image from 14.31.31103
to 14.32.31326.
[DROP MU_CHANGE TAGS] MdePkg/BaseMemoryLib: Prevent potential VS2022 linker failure
After updating between various VS2022 versions such as 17.4 to
17.5, , linker failures began to appear in several modules because
memset
is an unresolved symbol.The following functions in BaseMemoryLib/MemLibGeneric.c have their
loop pattern replaced with the
memset
intrinsic function:InternalMemSetMem16()
InternalMemSetMem32()
InternalMemSetMem64()
An example of an error related to
InternalMemSetMem64()
inVariableSmmRuntimeDxe is shown below:
This was reproduced in several environments including:
Public VM image:
https://github.com/actions/runner-images/blob/win22/20230226.1/images/win/Windows2022-Readme.md
Locally when updating from 17.4.4 to 17.5.1
This change updates the type cast for the destination buffer to be
a pointer to
volatile
data to prevent this optimization with arelatively minimum delta to prior implementation.
How This Was Tested
Integration Instructions