Skip to contentSkip to conversation

nodejs: make 14.18.1 available but not default

PATCH New nmali 1 participant 1 message May 11, 2023

lore
Share & tools
lore

nmali

author
#0 lore raw

PATCH v2 1/1 nodejs: make 14.18.1 available but not default

From: Narpat Mali <[email protected]>

Chromium 112 needs nodejs-native version 14 or later.
Add the nodejs_14.18.1 recipe from kirkstone:
246b20b92 nodejs: Upgrade to 14.18.1
but, use DEFAULT_PREFERENCE to make sure that the default version of nodejs remains 12.x.

7 patches which were modified between nodejs 12 & nodejs 14 were renamed by adding the suffix "-nodejs14". Note there are some common patches used by nodejs 12 & 14 so, that will require attention during future maintenance. In addition, there were 3 CVE-2022* patches which applied cleanly to nodejs 14 so, they were added to the nodejs 14 recipe. One patch, CVE-llhttp.patch conflicted so, it has not been applied in nodejs 14 yet.

Nodejs 14 compile for qemux86-64 but, no run-time testing has been performed.

For chromium, we would either require users to modify the local.conf file or we may create a dunfell specific branch in meta-browser.
See: https://github.com/OSSystems/meta-browser/pull/709

---
 ...-gyp-files-for-bundled-deps-nodejs14.patch |  22 ++
 ...ja-tests.py-add-py-3.10-fix-nodejs14.patch |  40 ++++
 ...use-mminimal-toc-with-clang-nodejs14.patch |  27 +++
 .../0002-Using-native-binaries-nodejs14.patch |  62 ++++++
 ...oth-binaries-and-use-libdir-nodejs14.patch |  84 +++++++
 .../nodejs/nodejs/libatomic-nodejs14.patch    |  21 ++
 .../nodejs/mips-less-memory-nodejs14.patch    |  32 +++
 .../recipes-devtools/nodejs/nodejs_14.18.1.bb | 205 ++++++++++++++++++
 8 files changed, 493 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/0001-Disable-running-gyp-files-for-bundled-deps-nodejs14.patch
 create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/0001-jinja-tests.py-add-py-3.10-fix-nodejs14.patch
 create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/0001-ppc64-Do-not-use-mminimal-toc-with-clang-nodejs14.patch
 create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/0002-Using-native-binaries-nodejs14.patch
 create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/0003-Install-both-binaries-and-use-libdir-nodejs14.patch
 create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/libatomic-nodejs14.patch
 create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/mips-less-memory-nodejs14.patch
 create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs_14.18.1.bb
meta-oe/recipes-devtools/nodejs/nodejs/0001-Disable-running-gyp-files-for-bundled-deps-nodejs14.patch new file +22 -0
new file mode 100644
index 000000000..c719c9c3b
@@ -0,0 +1,22 @@
+From 7d94bfe53beeb2d25eb5f2ff6b1d509df7e6ab80 Mon Sep 17 00:00:00 2001
+From: Zuzana Svetlikova <[email protected]>
+Date: Thu, 27 Apr 2017 14:25:42 +0200
+Subject: [PATCH] Disable running gyp on shared deps
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 93d63110..79caaec2 100644
+--- a/Makefile
++++ b/Makefile
+@@ -138,7 +138,7 @@ with-code-cache test-code-cache:
+	$(warning '$@' target is a noop)
+
+ out/Makefile: config.gypi common.gypi node.gyp \
+-	deps/uv/uv.gyp deps/llhttp/llhttp.gyp deps/zlib/zlib.gyp \
++	deps/llhttp/llhttp.gyp \
+	tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \
+	tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp
+	$(PYTHON) tools/gyp_node.py -f make
meta-oe/recipes-devtools/nodejs/nodejs/0001-jinja-tests.py-add-py-3.10-fix-nodejs14.patch new file +40 -0
new file mode 100644
index 000000000..8c5f75112
@@ -0,0 +1,40 @@
+From e1d838089cd461d9efcf4d29d9f18f65994d2d6b Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Sun, 3 Oct 2021 22:48:39 +0200
+Subject: [PATCH] jinja/tests.py: add py 3.10 fix
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <[email protected]>
+---
+ deps/v8/third_party/jinja2/tests.py      | 2 +-
+ tools/inspector_protocol/jinja2/tests.py | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/deps/v8/third_party/jinja2/tests.py b/deps/v8/third_party/jinja2/tests.py
+index 0adc3d4..b14f85f 100644
+--- a/deps/v8/third_party/jinja2/tests.py
++++ b/deps/v8/third_party/jinja2/tests.py
+@@ -10,7 +10,7 @@
+ """
+ import operator
+ import re
+-from collections import Mapping
++from collections.abc import Mapping
+ from jinja2.runtime import Undefined
+ from jinja2._compat import text_type, string_types, integer_types
+ import decimal
+diff --git a/tools/inspector_protocol/jinja2/tests.py b/tools/inspector_protocol/jinja2/tests.py
+index 0adc3d4..b14f85f 100644
+--- a/tools/inspector_protocol/jinja2/tests.py
++++ b/tools/inspector_protocol/jinja2/tests.py
+@@ -10,7 +10,7 @@
+ """
+ import operator
+ import re
+-from collections import Mapping
++from collections.abc import Mapping
+ from jinja2.runtime import Undefined
+ from jinja2._compat import text_type, string_types, integer_types
+ import decimal
+--
+2.20.1
meta-oe/recipes-devtools/nodejs/nodejs/0001-ppc64-Do-not-use-mminimal-toc-with-clang-nodejs14.patch new file +27 -0
new file mode 100644
index 000000000..ee287bf94
@@ -0,0 +1,27 @@
+From 0976af0f3b328436ea44a74a406f311adb2ab211 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 15 Jun 2021 19:01:31 -0700
+Subject: [PATCH] ppc64: Do not use -mminimal-toc with clang
+
+clang does not support this option
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ common.gypi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/common.gypi b/common.gypi
+index ee91fb1d..049c8f8c 100644
+--- a/common.gypi
++++ b/common.gypi
+@@ -413,7 +413,7 @@
+             'ldflags': [ '-m32' ],
+           }],
+           [ 'target_arch=="ppc64" and OS!="aix"', {
+-            'cflags': [ '-m64', '-mminimal-toc' ],
++            'cflags': [ '-m64' ],
+             'ldflags': [ '-m64' ],
+           }],
+           [ 'target_arch=="s390x"', {
+--
+2.32.0
meta-oe/recipes-devtools/nodejs/nodejs/0002-Using-native-binaries-nodejs14.patch new file +62 -0

62 lines not on this page · raw message

meta-oe/recipes-devtools/nodejs/nodejs/0003-Install-both-binaries-and-use-libdir-nodejs14.patch new file +84 -0

84 lines not on this page · raw message

meta-oe/recipes-devtools/nodejs/nodejs/libatomic-nodejs14.patch new file +21 -0
new file mode 100644
index 000000000..cdf6bc8e2
@@ -0,0 +1,21 @@
+Link mksnapshot with libatomic on x86
+
+Clang-12 on x86 emits atomic builtins
+
+Fixes
+| module-compiler.cc:(.text._ZN2v88internal4wasm12_GLOBAL__N_123ExecuteCompilationUnitsERKSt10shared_ptrINS2_22BackgroundCompileTokenEEPNS0_8CountersEiNS2_19CompileBaselineOnlyE+0x558): un
+defined reference to `__atomic_load'
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+
+--- a/tools/v8_gypfiles/v8.gyp
++++ b/tools/v8_gypfiles/v8.gyp
+@@ -1336,6 +1336,7 @@
+     {
+       'target_name': 'mksnapshot',
+       'type': 'executable',
++      'libraries': [ '-latomic' ],
+       'dependencies': [
+         'v8_base_without_compiler',
+         'v8_compiler_for_mksnapshot',
meta-oe/recipes-devtools/nodejs/nodejs/mips-less-memory-nodejs14.patch new file +32 -0
new file mode 100644
index 000000000..21a228123
@@ -0,0 +1,32 @@
+Description: mksnapshot uses too much memory on 32-bit mipsel
+Author: Jérémy Lal <[email protected]>
+Last-Update: 2020-06-03
+Forwarded: https://bugs.chromium.org/p/v8/issues/detail?id=10586
+
+This ensures that we reserve 500M instead of 2G range for codegen
+ensures that qemu-mips can allocate such large ranges
+
+Signed-off-by: Khem Raj <[email protected]>
+
+--- a/deps/v8/src/common/globals.h
++++ b/deps/v8/src/common/globals.h
+@@ -224,7 +224,7 @@ constexpr size_t kMinimumCodeRangeSize =
+ constexpr size_t kMinExpectedOSPageSize = 64 * KB;  // OS page on PPC Linux
+ #elif V8_TARGET_ARCH_MIPS
+ constexpr bool kPlatformRequiresCodeRange = false;
+-constexpr size_t kMaximalCodeRangeSize = 2048LL * MB;
++constexpr size_t kMaximalCodeRangeSize = 512 * MB;
+ constexpr size_t kMinimumCodeRangeSize = 0 * MB;
+ constexpr size_t kMinExpectedOSPageSize = 4 * KB;  // OS page.
+ #else
+--- a/deps/v8/src/codegen/mips/constants-mips.h
++++ b/deps/v8/src/codegen/mips/constants-mips.h
+@@ -140,7 +140,7 @@ const uint32_t kLeastSignificantByteInIn
+ namespace v8 {
+ namespace internal {
+
+-constexpr size_t kMaxPCRelativeCodeRangeInMB = 4096;
++constexpr size_t kMaxPCRelativeCodeRangeInMB = 1024;
+
+ // -----------------------------------------------------------------------------
+ // Registers and FPURegisters.
meta-oe/recipes-devtools/nodejs/nodejs_14.18.1.bb new file +205 -0

205 lines not on this page · raw message

Signature · 1 line
2.40.0