From 72f0932d692936e0414ee850efff95ca56f1f0dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 1 Mar 2022 08:59:55 +0100 Subject: [PATCH] deps: only use memfd_create if available The function that references it is only used for V8 testing. Refs: https://github.com/nodejs/node-v8/issues/220 --- common.gypi | 2 +- deps/v8/src/base/platform/platform-posix.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common.gypi b/common.gypi index 52af13554ba22f..308f9f221e3685 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,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.6', + 'v8_embedder_string': '-node.7', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/base/platform/platform-posix.cc b/deps/v8/src/base/platform/platform-posix.cc index 414c393aedc7a1..fbd76076a7a70c 100644 --- a/deps/v8/src/base/platform/platform-posix.cc +++ b/deps/v8/src/base/platform/platform-posix.cc @@ -576,7 +576,7 @@ void OS::FreeAddressSpaceReservation(AddressSpaceReservation reservation) { #if !defined(V8_OS_MACOS) // static PlatformSharedMemoryHandle OS::CreateSharedMemoryHandleForTesting(size_t size) { -#if V8_OS_LINUX && !V8_OS_ANDROID +#if V8_OS_LINUX && !V8_OS_ANDROID && defined(MFD_CLOEXEC) const char* name = "V8MemFDForTesting"; int fd = memfd_create(name, MFD_CLOEXEC); if (fd == -1) return kInvalidSharedMemoryHandle;