Skip to content

Commit 64a6328

Browse files
committed
deps: make V8 compilable with older glibc
Remove call to `memfd_create`. The function that references it is only used for V8 testing. PR-URL: #42657 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent fde5921 commit 64a6328

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.6',
39+
'v8_embedder_string': '-node.7',
4040

4141
##### V8 defaults for Node.js #####
4242

deps/v8/src/base/platform/platform-posix.cc

-18
Original file line numberDiff line numberDiff line change
@@ -581,25 +581,7 @@ void OS::FreeAddressSpaceReservation(AddressSpaceReservation reservation) {
581581
// Need to disable CFI_ICALL due to the indirect call to memfd_create.
582582
DISABLE_CFI_ICALL
583583
PlatformSharedMemoryHandle OS::CreateSharedMemoryHandleForTesting(size_t size) {
584-
#if V8_OS_LINUX && !V8_OS_ANDROID
585-
// Use memfd_create if available, otherwise mkstemp.
586-
using memfd_create_t = int (*)(const char*, unsigned int);
587-
memfd_create_t memfd_create =
588-
reinterpret_cast<memfd_create_t>(dlsym(RTLD_DEFAULT, "memfd_create"));
589-
int fd = -1;
590-
if (memfd_create) {
591-
fd = memfd_create("V8MemFDForTesting", MFD_CLOEXEC);
592-
} else {
593-
char filename[] = "/tmp/v8_tmp_file_for_testing_XXXXXX";
594-
fd = mkstemp(filename);
595-
if (fd != -1) CHECK_EQ(0, unlink(filename));
596-
}
597-
if (fd == -1) return kInvalidSharedMemoryHandle;
598-
CHECK_EQ(0, ftruncate(fd, size));
599-
return SharedMemoryHandleFromFileDescriptor(fd);
600-
#else
601584
return kInvalidSharedMemoryHandle;
602-
#endif
603585
}
604586

605587
// static

0 commit comments

Comments
 (0)