deps: V8: cherry-pick c38986131c02

Original commit message:

    Add V8_DISABLE_PRESERVE_MOST for embedders to opt out of preserve_most

    preserve_most changes the calling convention, which clang
    encodes in the mangled name (e.g. "U" instead of "A" for cdecl in the
    Microsoft C++ ABI). A consumer whose toolchain does not support
    the attribute would reference a differently mangled symbol.
    This patch adds a V8_DISABLE_PRESERVE_MOST to disable it, so that
    it's possible to link to V8 using different toolchains, as long
    as the value of it is set consistently.

    Refs: https://github.com/nodejs/node/pull/55784

    Change-Id: I67b49e739942d4026ac060be35bb39ec22256cbd
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8532546
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#111381}

Refs: https://github.com/v8/v8/commit/c38986131c02b6f24eb31d99d76ebf312a2b99aa
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/67070
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
Joyee Cheung authored and Chengzhong Wu committed 2026-11-19 10:34:05 -05:00
1 parent cb5e7a8fd7
commit 57e6b3cf40
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -50,7 +50,7 @@
# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.1',
'v8_embedder_string': '-node.2',
##### V8 defaults for Node.js #####
+1
View File
@@ -402,6 +402,7 @@ path. Add it with -I<path> to the command line
|| ((defined(__AARCH64EL__) || defined(_M_ARM64)) /* arm64, but ... */ \
&& !defined(_WIN32))) /* not on windows */ \
&& !defined(COMPONENT_BUILD) /* no component build */\
&& !defined(V8_DISABLE_PRESERVE_MOST) /* embedder opt-out */ \
&& __clang_major__ >= 17 /* clang >= 17 */
# define V8_HAS_ATTRIBUTE_PRESERVE_MOST (__has_attribute(preserve_most))
#endif