deps: V8: cherry-pick 415b7d302d2e

Original commit message:

    [platform] support madvise(3C) across ALL illumos revisions

    In illumos, madvise(3C) now takes `void *` for its first argument
    post-illumos#14418, but uses `caddr_t` pre-illumos#14418. This fix will
    detect if the illumos mman.h file in use is pre-or-post-illumos#14418 so
    builds can work either way.

    Co-Authored-By: Dan McDonald <danmcd@mnx.io>
    Refs: https://github.com/nodejs/node/pull/65161

Refs: https://github.com/v8/v8/commit/415b7d302d2e92344ce9a0c6da4855a2b0739037
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66601
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
Joyee CheungandDan McDonald authored and Antoine du Hamel committed 2026-10-15 16:35:51 +02:00
1 parent cb9469250e
commit 5fb4242977
2 files changed
+14 -2

No files matched your search

+1 -1
View File
@@ -44,7 +44,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 #####
+13 -1
View File
@@ -82,7 +82,19 @@
#define MAP_ANONYMOUS MAP_ANON
#endif
#if defined(V8_OS_SOLARIS)
/*
* NOTE: illumos starting with illumos#14418 (pushed April 20th, 2022)
* prototypes madvise(3C) properly with a `void *` first argument.
* The only way to detect this outside of configure-time checking is to
* check for the existence of MEMCNTL_SHARED, which gets defined for the first
* time in illumos#14418 under the same circumstances save _STRICT_POSIX, which
* thankfully neither Solaris nor illumos builds of Node or V8 do.
*
* If some future illumos push changes the MEMCNTL_SHARED assumptions made
* above, the illumos check below will have to be revisited. This check
* will work on both pre-and-post illumos#14418 illumos environments.
*/
#if defined(V8_OS_SOLARIS) && !(defined(__illumos__) && defined(MEMCNTL_SHARED))
#if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__)
extern "C" int madvise(caddr_t, size_t, int);
#else