Skip to content

Commit

Permalink
Revert "deps: make V8 compilable with older glibc"
Browse files Browse the repository at this point in the history
This reverts commit 84d455e.

PR-URL: #45162
Refs: #45118
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
targos authored and RafaelGSS committed Nov 1, 2022
1 parent c837b26 commit 1650b3e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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.17',
'v8_embedder_string': '-node.18',

##### V8 defaults for Node.js #####

Expand Down
19 changes: 19 additions & 0 deletions deps/v8/src/base/platform/platform-posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,26 @@ void OS::FreeAddressSpaceReservation(AddressSpaceReservation reservation) {
// Need to disable CFI_ICALL due to the indirect call to memfd_create.
DISABLE_CFI_ICALL
PlatformSharedMemoryHandle OS::CreateSharedMemoryHandleForTesting(size_t size) {
#if V8_OS_LINUX && !V8_OS_ANDROID
// Use memfd_create if available, otherwise mkstemp.
using memfd_create_t = int (*)(const char*, unsigned int);
memfd_create_t memfd_create =
reinterpret_cast<memfd_create_t>(dlsym(RTLD_DEFAULT, "memfd_create"));
int fd = -1;
if (memfd_create) {
fd = memfd_create("V8MemFDForTesting", 0);
}
if (fd == -1) {
char filename[] = "/tmp/v8_tmp_file_for_testing_XXXXXX";
fd = mkstemp(filename);
if (fd != -1) CHECK_EQ(0, unlink(filename));
}
if (fd == -1) return kInvalidSharedMemoryHandle;
CHECK_EQ(0, ftruncate(fd, size));
return SharedMemoryHandleFromFileDescriptor(fd);
#else
return kInvalidSharedMemoryHandle;
#endif
}

// static
Expand Down

0 comments on commit 1650b3e

Please sign in to comment.