Uh oh!
There was an error while loading. Please reload this page.
build: fix MSVC 2022 Release compilation - #46228
Conversation
nodejs-github-bot
commented
Jan 16, 2023
Review requested:
|
targos
left a comment
There was a problem hiding this comment.
It looks like a reasonable fix. Thank you!
targos
commented
Jan 17, 2023
I cherry-picked my commit from #46125 to test it. |
nodejs-github-bot
commented
Jan 17, 2023
nodejs-github-bot
commented
Jan 17, 2023
nodejs-github-bot
commented
Jan 17, 2023
eukarpov
commented
Jan 17, 2023
#46231 fixes the problem differently |
targos
commented
Jan 18, 2023
@eukarpov do you think the fix here is wrong? |
nodejs-github-bot
commented
Jan 18, 2023
nodejs-github-bot
commented
Jan 18, 2023
eukarpov
commented
Jan 18, 2023
It is different than I proposed in my PR, however it looks good for me. |
StefanStojanovic
commented
Jan 20, 2023
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? |
eukarpov
commented
Jan 20, 2023
@StefanStojanovic PR #46231 should fix this issue |
StefanStojanovic
commented
Jan 20, 2023
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
8ab4121Compare8ab4121 to
ffe17f8Comparenodejs-github-bot
commented
Jan 27, 2023
nodejs-github-bot
commented
Jan 27, 2023
nodejs-github-bot
commented
Jan 27, 2023
mhdawson
commented
Jan 27, 2023
Landed in 19bcba0 |
PR-URL: #46228 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
vmoroz
commented
Jan 27, 2023
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>
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
mksnapshotproject in thev8.gypfile to solve #43092.directory.build.propsis added to overridePreprocessedFileNameoutput path to address the file access violation issue.Details
When we build Node.JS Release in MSVC 2022 we see linker errors that
mksnapshotcannot findFixedArray::getmethod. This is an example of the linker error from issue #43092:It seemed that the inlined method
FixedArray::getis optimized out.We can either change V8 files and explicitly include
fixed-array-inl.hfile as in PR #46231, or we can use the forced file inclusion used by PCH files. Adding the MSVC specific PCH formksnapshotproject addresses the issue.The root cause of the access violation issue is that the
embedded.Sfile 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.Sfile while reading it.In this PR we add new
directory.build.propsfile that locally overrides themarmasm.propsdefinition by adding.ppextension 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.