-
Notifications
You must be signed in to change notification settings - Fork 30k
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
build: fix MSVC 2022 Release compilation #46228
Conversation
Review requested:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like a reasonable fix. Thank you!
I cherry-picked my commit from #46125 to test it. |
#46231 fixes the problem differently |
@eukarpov do you think the fix here is wrong? |
It is different than I proposed in my PR, however it looks good for me. |
I've tested this PR and it fixes x64 and x86 release builds nicely. However, when cross-compiling for ARM64 (eg. running
When cross-compiling on the main branch, I get the same linking errors as for the x64/x86 release builds:
Could you please investigate this issue further and see what's the root cause? |
@StefanStojanovic PR #46231 should fix this issue |
Yes, it looks like it does. I tried building releases for all x86, x64, and ARM64 and all builds were successful. |
I played a little bit with it, and you are right: my solution worked fine for x86 and x64, but it failed for ARM64. Adding the metadata The root cause of the access violation issue is that the My last commit implements the same fix as in PR #46231 by adding new |
109f0f7
to
8ab4121
Compare
8ab4121
to
ffe17f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM based on approval from Stefan from Microsoft team
Landed in 19bcba0 |
PR-URL: #46228 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
Thank you! :) |
PR-URL: #46228 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
PR-URL: #46228 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
PR-URL: #46228 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
PR-URL: #46228 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
Fixes Release build on VS2022 ARM64
This PR targets to address the Linker errors mentioned in Issue #43092 when we build Node.JS main branch in MSVC 2022 (Version 17.4.4).
Then, it fixes the VS2022 ARM64 build issue with file access violation originally fixed by PR #46231.
The fix adds PCH file to
mksnapshot
project in thev8.gyp
file to solve #43092.directory.build.props
is added to overridePreprocessedFileName
output path to address the file access violation issue.Details
When we build Node.JS Release in MSVC 2022 we see linker errors that
mksnapshot
cannot findFixedArray::get
method. This is an example of the linker error from issue #43092:It seemed that the inlined method
FixedArray::get
is optimized out.We can either change V8 files and explicitly include
fixed-array-inl.h
file as in PR #46231, or we can use the forced file inclusion used by PCH files. Adding the MSVC specific PCH formksnapshot
project addresses the issue.The root cause of the access violation issue is that the
embedded.S
file is generated in the$(IntDir)
folder while the preprocessed file name uses exactly the same path:<PreprocessedFileName Condition="'%(PreprocessedFileName)' == ''">$(IntDir)%(FileName)%(Extension)</PreprocessedFileName>
from"c:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\BuildCustomizations\marmasm.props"
. Thus, we are getting error because we try to change theembedded.S
file while reading it.In this PR we add new
directory.build.props
file that locally overrides themarmasm.props
definition by adding.pp
extension to the file name. It generates output file name that is different in from the input file name and addresses the file access violation issue.