-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libnode] Update to v18.12.1 (Latest LTS) and add scripts for win64 a…
…nd mac builds. (#5859) * Update for building NodeJS v18.12.1. Add scripts for w64 and mac. * Try building with trap-handler on aarch64-linux. * chmod +x * Disable pointer authentication on arm 64. (nodejs/node#42888) * Include a header to use `memalign`.
- Loading branch information
Showing
7 changed files
with
143 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/configure.py b/configure.py | ||
index a4e5723067..60ec604454 100755 | ||
--- a/configure.py | ||
+++ b/configure.py | ||
@@ -1245,9 +1245,9 @@ def configure_node(o): | ||
|
||
o['variables']['want_separate_host_toolset'] = int(cross_compiling) | ||
|
||
- # Enable branch protection for arm64 | ||
- if target_arch == 'arm64': | ||
- o['cflags']+=['-msign-return-address=all'] | ||
+ # # Enable branch protection for arm64 | ||
+ # if target_arch == 'arm64': | ||
+ # o['cflags']+=['-msign-return-address=all'] | ||
|
||
if options.node_snapshot_main is not None: | ||
if options.shared: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/node.gypi b/node.gypi | ||
index 0b0f05322e..25ce3e14c6 100644 | ||
--- a/node.gypi | ||
+++ b/node.gypi | ||
@@ -327,7 +327,7 @@ | ||
'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ], | ||
}], | ||
[ 'OS=="linux"', { | ||
- 'libraries!': [ | ||
+ 'libraries': [ | ||
'-lrt' | ||
], | ||
}], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
diff --git a/src/node_credentials.cc b/src/node_credentials.cc | ||
index 115c2fc877..946f39f7b4 100644 | ||
--- a/src/node_credentials.cc | ||
+++ b/src/node_credentials.cc | ||
@@ -13,7 +13,13 @@ | ||
#endif | ||
#ifdef __linux__ | ||
#include <linux/capability.h> | ||
-#include <sys/auxv.h> | ||
+#include <elf.h> | ||
+#ifdef __LP64__ | ||
+#define Elf_auxv_t Elf64_auxv_t | ||
+#else | ||
+#define Elf_auxv_t Elf32_auxv_t | ||
+#endif // __LP64__ | ||
+extern char** environ; | ||
#include <sys/syscall.h> | ||
#endif // __linux__ | ||
|
||
@@ -38,8 +44,15 @@ bool linux_at_secure() { | ||
// and returns the correct value, e.g. even in static | ||
// initialization code in other files. | ||
#ifdef __linux__ | ||
- static const bool value = getauxval(AT_SECURE); | ||
- return value; | ||
+ char** envp = environ; | ||
+ while (*envp++ != nullptr) {} | ||
+ Elf_auxv_t* auxv = reinterpret_cast<Elf_auxv_t*>(envp); | ||
+ for (; auxv->a_type != AT_NULL; auxv++) { | ||
+ if (auxv->a_type == AT_SECURE) { | ||
+ static const bool value = auxv->a_un.a_val; | ||
+ return value; | ||
+ } | ||
+ } | ||
#else | ||
return false; | ||
#endif |
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
L/libnode/bundled/patches/test_crypto_clienthello.cc.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git a/test/cctest/test_crypto_clienthello.cc b/test/cctest/test_crypto_clienthello.cc | ||
index 60a8e294c8..e673073dc3 100644 | ||
--- a/test/cctest/test_crypto_clienthello.cc | ||
+++ b/test/cctest/test_crypto_clienthello.cc | ||
@@ -16,6 +16,7 @@ | ||
// safety is violated. | ||
#if !defined(NO_GUARD_PAGE) | ||
#ifdef __linux__ | ||
+#include <malloc.h> | ||
#include <sys/mman.h> | ||
#include <unistd.h> | ||
#if defined(_SC_PAGE_SIZE) && defined(PROT_NONE) && defined(PROT_READ) && \ | ||
@@ -54,7 +55,7 @@ class OverrunGuardedBuffer { | ||
#ifdef USE_MPROTECT | ||
// Place the packet right before a guard page, which, when accessed, causes | ||
// a segmentation fault. | ||
- alloc_base = static_cast<uint8_t*>(aligned_alloc(page, 2 * page)); | ||
+ alloc_base = static_cast<uint8_t*>(memalign(page, 2 * page)); | ||
EXPECT_NE(alloc_base, nullptr); | ||
uint8_t* second_page = alloc_base + page; | ||
EXPECT_EQ(mprotect(second_page, page, PROT_NONE), 0); |
This file was deleted.
Oops, something went wrong.