deps: define V8_PRESERVE_MOST as no-op on Windows

It's causing linker errors with node.lib in node-gyp and potentially
breaks other 3rd party tools

PR-URL: https://github.com/nodejs/node/pull/56238
Refs: https://github.com/nodejs/node/pull/55784
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/58064
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
This commit is contained in:
Stefan Stojanovic 2024-12-16 11:11:22 +01:00 committed by Node.js GitHub Bot
parent a738eb4a7f
commit d234475a33
2 changed files with 5 additions and 1 deletions

View file

@ -38,7 +38,7 @@
# Reset this number to 0 on major V8 upgrades. # Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8. # Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.2', 'v8_embedder_string': '-node.3',
##### V8 defaults for Node.js ##### ##### V8 defaults for Node.js #####

View file

@ -592,11 +592,15 @@ path. Add it with -I<path> to the command line
// functions. // functions.
// Use like: // Use like:
// V8_NOINLINE V8_PRESERVE_MOST void UnlikelyMethod(); // V8_NOINLINE V8_PRESERVE_MOST void UnlikelyMethod();
#if V8_OS_WIN
# define V8_PRESERVE_MOST
#else
#if V8_HAS_ATTRIBUTE_PRESERVE_MOST #if V8_HAS_ATTRIBUTE_PRESERVE_MOST
# define V8_PRESERVE_MOST __attribute__((preserve_most)) # define V8_PRESERVE_MOST __attribute__((preserve_most))
#else #else
# define V8_PRESERVE_MOST /* NOT SUPPORTED */ # define V8_PRESERVE_MOST /* NOT SUPPORTED */
#endif #endif
#endif
// A macro (V8_DEPRECATED) to mark classes or functions as deprecated. // A macro (V8_DEPRECATED) to mark classes or functions as deprecated.