summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/nodejs/nodejs_22.22.2.bb
diff options
context:
space:
mode:
authorJason Schonberg <schonm@gmail.com>2026-03-24 22:43:55 -0400
committerKhem Raj <khem.raj@oss.qualcomm.com>2026-03-24 23:32:48 -0700
commitd32cd27eaaa13b296c268df234d2fb2cefa62946 (patch)
treeaf3836559249f75f7da87942dfa8b6c7d98649f6 /meta-oe/recipes-devtools/nodejs/nodejs_22.22.2.bb
parent9fb95d3d7ea1697068640cdcbfb266cb6d3959a6 (diff)
downloadmeta-openembedded-d32cd27eaaa13b296c268df234d2fb2cefa62946.tar.gz
nodejs: upgrade 22.22.1 -> 22.22.2
This is the March 2026 security release. 2 high severity issues. 5 medium severity issues. 2 low severity issues. High priority fixes: CVE-2026-21637 CVE-2026-21710 Medium priority fixes: CVE-2026-21711 (affects only nodejs v25) CVE-2026-21712 (affects only nodejs v24 & v25) CVE-2026-21713 CVE-2026-21714 CVE-2026-21717 Low priority fixes: CVE-2026-21715 CVE-2026-21716 https://nodejs.org/en/blog/vulnerability/march-2026-security-releases Changelog: https://github.com/nodejs/node/releases/tag/v22.22.2 Signed-off-by: Jason Schonberg <schonm@gmail.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
Diffstat (limited to 'meta-oe/recipes-devtools/nodejs/nodejs_22.22.2.bb')
-rw-r--r--meta-oe/recipes-devtools/nodejs/nodejs_22.22.2.bb216
1 files changed, 216 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_22.22.2.bb b/meta-oe/recipes-devtools/nodejs/nodejs_22.22.2.bb
new file mode 100644
index 0000000000..8bd5f008af
--- /dev/null
+++ b/meta-oe/recipes-devtools/nodejs/nodejs_22.22.2.bb
@@ -0,0 +1,216 @@
1DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript"
2HOMEPAGE = "http://nodejs.org"
3LICENSE = "MIT & ISC & BSD-2-Clause & BSD-3-Clause & Artistic-2.0 & Apache-2.0 & BlueOak-1.0.0"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=b195f4ea4368177a2fd84b879f09cba8"
5
6CVE_PRODUCT = "nodejs node.js"
7
8DEPENDS = "openssl openssl-native file-replacement-native python3-packaging-native"
9DEPENDS:append:class-target = " qemu-native"
10DEPENDS:append:class-native = " c-ares-native"
11
12inherit pkgconfig python3native qemu ptest siteinfo
13
14COMPATIBLE_MACHINE:armv4 = "(!.*armv4).*"
15COMPATIBLE_MACHINE:armv5 = "(!.*armv5).*"
16COMPATIBLE_MACHINE:mips64 = "(!.*mips64).*"
17
18COMPATIBLE_HOST:riscv64 = "null"
19COMPATIBLE_HOST:riscv32 = "null"
20COMPATIBLE_HOST:powerpc = "null"
21COMPATIBLE_HOST:powerpc64le = "null"
22
23SRC_URI = "https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \
24 file://0001-Do-not-use-glob-in-deps.patch \
25 file://0001-Disable-running-gyp-files-for-bundled-deps.patch \
26 file://0004-v8-don-t-override-ARM-CFLAGS.patch \
27 file://system-c-ares.patch \
28 file://0001-liftoff-Correct-function-signatures.patch \
29 file://libatomic.patch \
30 file://0001-deps-disable-io_uring-support-in-libuv.patch \
31 file://0001-positional-args.patch \
32 file://0001-custom-env.patch \
33 file://0001-build-remove-redundant-mXX-flags-for-V8.patch \
34 file://0001-fix-arm-Neon-intrinsics-types.patch \
35 file://0001-detect-aarch64-Neon-correctly.patch \
36 file://0001-llhttp-fix-NEON-header-value-__builtin_ctzll-undefin.patch \
37 file://run-ptest \
38 "
39SRC_URI:append:class-target = " \
40 file://0001-Using-native-binaries.patch \
41 "
42SRC_URI:append:toolchain-clang:powerpc64le = " \
43 file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \
44 "
45SRC_URI[sha256sum] = "b6bedd3a8cacd5df7df015a5088264b12c74a277ba60684cb9642ae8eb743132"
46
47S = "${UNPACKDIR}/node-v${PV}"
48
49# v8 errors out if you have set CCACHE
50CCACHE = ""
51
52def map_nodejs_arch(a, d):
53 import re
54
55 if re.match('i.86$', a): return 'ia32'
56 elif re.match('x86_64$', a): return 'x64'
57 elif re.match('aarch64$', a): return 'arm64'
58 elif re.match('(powerpc64|powerpc64le|ppc64le)$', a): return 'ppc64'
59 elif re.match('powerpc$', a): return 'ppc'
60 return a
61
62ARCHFLAGS:arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--with-arm-float-abi=hard', '--with-arm-float-abi=softfp', d)} \
63 ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-arm-fpu=neon', \
64 bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', '--with-arm-fpu=vfpv3-d16', \
65 bb.utils.contains('TUNE_FEATURES', 'vfpv3', '--with-arm-fpu=vfpv3', \
66 '--with-arm-fpu=vfp', d), d), d)}"
67ARCHFLAGS:append:mips = " --v8-lite-mode"
68ARCHFLAGS:append:mipsel = " --v8-lite-mode"
69ARCHFLAGS ?= ""
70
71PACKAGECONFIG ??= "ares brotli icu zlib"
72
73PACKAGECONFIG[ares] = "--shared-cares,,c-ares c-ares-native"
74PACKAGECONFIG[brotli] = "--shared-brotli,,brotli brotli-native"
75PACKAGECONFIG[icu] = "--with-intl=system-icu,--without-intl,icu icu-native"
76PACKAGECONFIG[libuv] = "--shared-libuv,,libuv libuv-native"
77PACKAGECONFIG[nghttp2] = "--shared-nghttp2,,nghttp2 nghttp2-native"
78PACKAGECONFIG[shared] = "--shared"
79PACKAGECONFIG[zlib] = "--shared-zlib,,zlib"
80
81EXTRANATIVEPATH += "file-native"
82
83python prune_sources() {
84 import shutil
85
86 shutil.rmtree(d.getVar('S') + '/deps/openssl')
87 if 'ares' in d.getVar('PACKAGECONFIG'):
88 shutil.rmtree(d.getVar('S') + '/deps/cares')
89 if 'brotli' in d.getVar('PACKAGECONFIG'):
90 shutil.rmtree(d.getVar('S') + '/deps/brotli')
91 if 'libuv' in d.getVar('PACKAGECONFIG'):
92 shutil.rmtree(d.getVar('S') + '/deps/uv')
93 if 'nghttp2' in d.getVar('PACKAGECONFIG'):
94 shutil.rmtree(d.getVar('S') + '/deps/nghttp2')
95 if 'zlib' in d.getVar('PACKAGECONFIG'):
96 shutil.rmtree(d.getVar('S') + '/deps/zlib')
97}
98do_patch[postfuncs] += "prune_sources"
99
100# V8's JIT infrastructure requires binaries such as mksnapshot and
101# mkpeephole to be run in the host during the build. However, these
102# binaries must have the same bit-width as the target (e.g. a x86_64
103# host targeting ARMv6 needs to produce a 32-bit binary).
104# 1. If host and target have the different bit width, run those
105# binaries for the target and run them on the host with QEMU.
106# 2. If host and target have the same bit width, enable upstream
107# cross compile support and no QEMU
108python do_create_v8_qemu_wrapper () {
109 """Creates a small wrapper that invokes QEMU to run some target V8 binaries
110 on the host."""
111 qemu_libdirs = [d.expand('${STAGING_DIR_HOST}${libdir}'),
112 d.expand('${STAGING_DIR_HOST}${base_libdir}')]
113 qemu_cmd = qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'),
114 qemu_libdirs)
115
116 if d.getVar("HOST_AND_TARGET_SAME_WIDTH") == "1":
117 qemu_cmd = ""
118
119 wrapper_path = d.expand('${B}/v8-qemu-wrapper.sh')
120 with open(wrapper_path, 'w') as wrapper_file:
121 wrapper_file.write("""#!/bin/sh
122
123# This file has been generated automatically.
124# It invokes QEMU to run binaries built for the target in the host during the
125# build process.
126
127%s "$@"
128""" % qemu_cmd)
129 os.chmod(wrapper_path, 0o755)
130}
131
132do_create_v8_qemu_wrapper[dirs] = "${B}"
133addtask create_v8_qemu_wrapper after do_configure before do_compile
134
135export CC_host
136export CFLAGS_host
137export CXX_host
138export CXXFLAGS_host
139export LDFLAGS_host
140export AR_host
141export HOST_AND_TARGET_SAME_WIDTH
142
143CROSS_FLAGS = "--cross-compiling"
144CROSS_FLAGS:class-native = "--no-cross-compiling"
145
146# Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi
147do_configure () {
148 GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES
149 # $TARGET_ARCH settings don't match --dest-cpu settings
150 python3 configure.py --verbose --prefix=${prefix} \
151 --shared-openssl \
152 --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \
153 --dest-os=linux \
154 --libdir=${baselib} \
155 ${CROSS_FLAGS} \
156 ${ARCHFLAGS} \
157 ${PACKAGECONFIG_CONFARGS}
158}
159
160do_compile () {
161 install -D ${RECIPE_SYSROOT_NATIVE}/etc/ssl/openssl.cnf ${B}/deps/openssl/nodejs-openssl.cnf
162 install -D ${B}/v8-qemu-wrapper.sh ${B}/out/Release/v8-qemu-wrapper.sh
163 oe_runmake BUILDTYPE=Release
164}
165
166do_install () {
167 oe_runmake install DESTDIR=${D}
168}
169
170do_install_ptest () {
171 cp -r ${B}/out/Release/cctest ${D}${PTEST_PATH}/
172 cp -r ${B}/test ${D}${PTEST_PATH}
173 chown -R root:root ${D}${PTEST_PATH}
174}
175
176PACKAGES =+ "${PN}-npm"
177FILES:${PN}-npm = "${nonarch_libdir}/node_modules ${bindir}/npm ${bindir}/npx ${bindir}/corepack"
178RDEPENDS:${PN}-npm = "bash python3-core python3-shell python3-datetime \
179 python3-misc python3-multiprocessing"
180
181PACKAGES =+ "${PN}-systemtap"
182FILES:${PN}-systemtap = "${datadir}/systemtap"
183
184do_configure[prefuncs] += "set_gyp_variables"
185do_compile[prefuncs] += "set_gyp_variables"
186do_install[prefuncs] += "set_gyp_variables"
187python set_gyp_variables () {
188 if d.getVar("HOST_AND_TARGET_SAME_WIDTH") == "0":
189 # We don't want to cross-compile during target compile,
190 # and we need to use the right flags during host compile,
191 # too.
192 d.setVar("CC_host", d.getVar("CC") + " -pie -fPIE")
193 d.setVar("CFLAGS_host", d.getVar("CFLAGS"))
194 d.setVar("CXX_host", d.getVar("CXX") + " -pie -fPIE")
195 d.setVar("CXXFLAGS_host", d.getVar("CXXFLAGS"))
196 d.setVar("LDFLAGS_host", d.getVar("LDFLAGS"))
197 d.setVar("AR_host", d.getVar("AR"))
198 elif d.getVar("HOST_AND_TARGET_SAME_WIDTH") == "1":
199 # Enable upstream cross compile support
200 d.setVar("CC_host", d.getVar("BUILD_CC"))
201 d.setVar("CFLAGS_host", d.getVar("BUILD_CFLAGS"))
202 d.setVar("CXX_host", d.getVar("BUILD_CXX"))
203 d.setVar("CXXFLAGS_host", d.getVar("BUILD_CXXFLAGS"))
204 d.setVar("LDFLAGS_host", d.getVar("BUILD_LDFLAGS"))
205 d.setVar("AR_host", d.getVar("BUILD_AR"))
206}
207
208python __anonymous () {
209 # 32 bit target and 64 bit host (x86-64 or aarch64) have different bit width
210 if d.getVar("SITEINFO_BITS") == "32" and "64" in d.getVar("BUILD_ARCH"):
211 d.setVar("HOST_AND_TARGET_SAME_WIDTH", "0")
212 else:
213 d.setVar("HOST_AND_TARGET_SAME_WIDTH", "1")
214}
215
216BBCLASSEXTEND = "native"