summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Schonberg <schonm@gmail.com>2026-05-23 17:00:27 +1200
committerAnuj Mittal <anuj.mittal@oss.qualcomm.com>2026-05-29 09:29:32 +0530
commit74c663dd4ed728d956cf5f0000200bfc58e80366 (patch)
treecd707879f71a52040ec4a4189be447d83dbd5b37
parenta1ffc4960b616619e6da3778c9e4ee8e7e2400ca (diff)
downloadmeta-openembedded-74c663dd4ed728d956cf5f0000200bfc58e80366.tar.gz
nodejs: upgrade 22.22.2 -> 22.22.3
With this upgrade, nodejs updated the llhttp dependency to version 9.3.1 So some of the patches are nolonger necessary. Changelog: https://github.com/nodejs/node/releases/tag/v22.22.3 Signed-off-by: Jason Schonberg <schonm@gmail.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com> (cherry picked from commit ea56a5e3ae463a1b9d28298f47f27b40e519ca6d) Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com> Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
-rw-r--r--meta-oe/recipes-devtools/nodejs/nodejs/0001-detect-aarch64-Neon-correctly.patch51
-rw-r--r--meta-oe/recipes-devtools/nodejs/nodejs/0001-fix-arm-Neon-intrinsics-types.patch59
-rw-r--r--meta-oe/recipes-devtools/nodejs/nodejs/0001-llhttp-fix-NEON-header-value-__builtin_ctzll-undefin.patch60
-rw-r--r--meta-oe/recipes-devtools/nodejs/nodejs_22.22.3.bb (renamed from meta-oe/recipes-devtools/nodejs/nodejs_22.22.2.bb)5
4 files changed, 1 insertions, 174 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/0001-detect-aarch64-Neon-correctly.patch b/meta-oe/recipes-devtools/nodejs/nodejs/0001-detect-aarch64-Neon-correctly.patch
deleted file mode 100644
index 15de2c1119..0000000000
--- a/meta-oe/recipes-devtools/nodejs/nodejs/0001-detect-aarch64-Neon-correctly.patch
+++ /dev/null
@@ -1,51 +0,0 @@
1From 41ec2d5302b77be27ca972102c29ce12471ed4b0 Mon Sep 17 00:00:00 2001
2From: Gyorgy Sarvari <skandigraun@gmail.com>
3Date: Thu, 12 Feb 2026 11:09:44 +0100
4Subject: [PATCH 2/2] detect aarch64 Neon correctly
5
6The llhttp vendored dependency of nodejs takes advantage of Arm NEON
7instructions when they are available, however they are detected by
8checking for an outdated CPU feature macro: it checks for __ARM_NEON__,
9however it is not defined by new compilers for aarch64, rather they
10set __ARM_NEON. The Arm C extension guide[1] refers to __ARM_NEON macro
11aswell.
12
13This patch changes the detection to check for both macros when detecting
14the availability of NEON instructions.
15
16The code this patch modifies is generated, so the patch itself isn't
17suitable for upstream submission, as the root cause of the error is
18in the generator itself. A PR has been submitted[2] to the generator
19project to rectify this issue.
20
21[1]: https://developer.arm.com/documentation/ihi0053/d/ - pdf, section 6.9
22[2]: https://github.com/nodejs/llparse/pull/84
23
24Upstream-Status: Inappropriate [see above]
25Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
26---
27 deps/llhttp/src/llhttp.c | 4 ++--
28 1 file changed, 2 insertions(+), 2 deletions(-)
29
30diff --git a/deps/llhttp/src/llhttp.c b/deps/llhttp/src/llhttp.c
31index a0e59e50..b069bbbb 100644
32--- a/deps/llhttp/src/llhttp.c
33+++ b/deps/llhttp/src/llhttp.c
34@@ -10,7 +10,7 @@
35 #endif /* _MSC_VER */
36 #endif /* __SSE4_2__ */
37
38-#ifdef __ARM_NEON__
39+#if defined(__ARM_NEON__) || defined(__ARM_NEON)
40 #include <arm_neon.h>
41 #endif /* __ARM_NEON__ */
42
43@@ -2625,7 +2625,7 @@ static llparse_state_t llhttp__internal__run(
44 goto s_n_llhttp__internal__n_header_value_otherwise;
45 }
46 #endif /* __SSE4_2__ */
47- #ifdef __ARM_NEON__
48+ #if defined(__ARM_NEON__) || defined(__ARM_NEON)
49 while (endp - p >= 16) {
50 uint8x16_t input;
51 uint8x16_t single;
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/0001-fix-arm-Neon-intrinsics-types.patch b/meta-oe/recipes-devtools/nodejs/nodejs/0001-fix-arm-Neon-intrinsics-types.patch
deleted file mode 100644
index ddbad575f0..0000000000
--- a/meta-oe/recipes-devtools/nodejs/nodejs/0001-fix-arm-Neon-intrinsics-types.patch
+++ /dev/null
@@ -1,59 +0,0 @@
1From 3f4283dac7d88a89b42f1f2966a862cee5afe486 Mon Sep 17 00:00:00 2001
2From: Gyorgy Sarvari <skandigraun@gmail.com>
3Date: Thu, 12 Feb 2026 11:03:53 +0100
4Subject: [PATCH 1/2] fix arm Neon intrinsics types
5
6The current code calls these intrinsics with incorrect datatypes
7(it uses a vector of uint16 instead of uint8), causing compilation
8to fail with the following error:
9
10| ../deps/llhttp/src/llhttp.c: In function 'llhttp__internal__run':
11| ../deps/llhttp/src/llhttp.c:2645:9: note: use '-flax-vector-conversions' to permit conversions between vectors with differing element types or numbers of subparts
12| 2645 | );
13| | ^
14| ../deps/llhttp/src/llhttp.c:2643:11: error: incompatible type for argument 1 of 'vandq_u16'
15| 2643 | vcgeq_u8(input, vdupq_n_u8(' ')),
16
17To avoid this, set the correct intrinsics call that matches the
18actual arguments.
19
20The code that this patch modifies is generated code, so in itself
21this change isn't appropriate for upstream. The actual problem
22is in the code generator itself, for which a PR is already pending
23for merging[1]. This patch is a port of that PR.
24
25[1]: https://github.com/nodejs/llparse/pull/79
26
27Upstream-Status: Inappropriate [see above]
28Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
29---
30 deps/llhttp/src/llhttp.c | 12 ++++++------
31 1 file changed, 6 insertions(+), 6 deletions(-)
32
33diff --git a/deps/llhttp/src/llhttp.c b/deps/llhttp/src/llhttp.c
34index aa4c4682..887603fd 100644
35--- a/deps/llhttp/src/llhttp.c
36+++ b/deps/llhttp/src/llhttp.c
37@@ -2639,17 +2639,17 @@ static llparse_state_t llhttp__internal__run(
38 /* Find first character that does not match `ranges` */
39 single = vceqq_u8(input, vdupq_n_u8(0x9));
40 mask = single;
41- single = vandq_u16(
42+ single = vandq_u8(
43 vcgeq_u8(input, vdupq_n_u8(' ')),
44 vcleq_u8(input, vdupq_n_u8('~'))
45 );
46- mask = vorrq_u16(mask, single);
47- single = vandq_u16(
48+ mask = vorrq_u8(mask, single);
49+ single = vandq_u8(
50 vcgeq_u8(input, vdupq_n_u8(0x80)),
51 vcleq_u8(input, vdupq_n_u8(0xff))
52 );
53- mask = vorrq_u16(mask, single);
54- narrow = vshrn_n_u16(mask, 4);
55+ mask = vorrq_u8(mask, single);
56+ narrow = vshrn_n_u16(vreinterpretq_u16_u8(mask), 4);
57 match_mask = ~vget_lane_u64(vreinterpret_u64_u8(narrow), 0);
58 match_len = __builtin_ctzll(match_mask) >> 2;
59 if (match_len != 16) {
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/0001-llhttp-fix-NEON-header-value-__builtin_ctzll-undefin.patch b/meta-oe/recipes-devtools/nodejs/nodejs/0001-llhttp-fix-NEON-header-value-__builtin_ctzll-undefin.patch
deleted file mode 100644
index 683dddcf04..0000000000
--- a/meta-oe/recipes-devtools/nodejs/nodejs/0001-llhttp-fix-NEON-header-value-__builtin_ctzll-undefin.patch
+++ /dev/null
@@ -1,60 +0,0 @@
1From a63a5faea54055973bf5f0a514444532563cc20d Mon Sep 17 00:00:00 2001
2From: Telukula Jeevan Kumar Sahu <j-sahu@ti.com>
3Date: Fri, 27 Feb 2026 20:58:43 +0530
4Subject: [PATCH] llhttp: fix NEON header value __builtin_ctzll undefined
5 behavior
6
7When all 16 bytes match the allowed range, match_mask becomes 0 after
8the bitwise NOT. Calling __builtin_ctzll(0) is undefined behavior per
9the C standard.
10
11The code expects match_len == 16 when all bytes match (so the branch
12is skipped and p += 16 continues the loop), but this relied on
13ctzll(0) returning 64, which is not guaranteed.
14
15GCC at -O2 exploits this UB by deducing that __builtin_ctzll() result
16is always in range [0, 63], and after >> 2 always in [0, 15], which
17is never equal to 16. The compiler then optimizes
18"if (match_len != 16)" to always-true, causing every valid 16-byte
19chunk to be falsely rejected as containing an invalid character.
20
21This manifests as HTTP 400 Bad Request (HPE_INVALID_HEADER_TOKEN) for
22any HTTP header value longer than 16 characters on ARM targets with
23NEON enabled.
24
25Fix by explicitly checking for match_mask == 0 and setting
26match_len = 16, avoiding the undefined behavior entirely. This bug
27affects both aarch64 and armv7 NEON targets.
28
29The fix has been merged upstream in llparse 7.3.1 [1] and is included
30in llhttp 9.3.1. This patch can be dropped when nodejs updates its
31bundled llhttp to >= 9.3.1.
32
33[1]: https://github.com/nodejs/llparse/pull/83
34
35Upstream-Status: Inappropriate
36Signed-off-by: Telukula Jeevan Kumar Sahu <j-sahu@ti.com>
37---
38 deps/llhttp/src/llhttp.c | 6 +++++-
39 1 file changed, 5 insertions(+), 1 deletion(-)
40
41diff --git a/deps/llhttp/src/llhttp.c b/deps/llhttp/src/llhttp.c
42index 14b731e..b0a46c6 100644
43--- a/deps/llhttp/src/llhttp.c
44+++ b/deps/llhttp/src/llhttp.c
45@@ -2651,7 +2651,11 @@ static llparse_state_t llhttp__internal__run(
46 mask = vorrq_u8(mask, single);
47 narrow = vshrn_n_u16(vreinterpretq_u16_u8(mask), 4);
48 match_mask = ~vget_lane_u64(vreinterpret_u64_u8(narrow), 0);
49- match_len = __builtin_ctzll(match_mask) >> 2;
50+ if (match_mask == 0) {
51+ match_len = 16;
52+ } else {
53+ match_len = __builtin_ctzll(match_mask) >> 2;
54+ }
55 if (match_len != 16) {
56 p += match_len;
57 goto s_n_llhttp__internal__n_header_value_otherwise;
58--
592.34.1
60
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_22.22.2.bb b/meta-oe/recipes-devtools/nodejs/nodejs_22.22.3.bb
index 3a1385f70a..a13b71b762 100644
--- a/meta-oe/recipes-devtools/nodejs/nodejs_22.22.2.bb
+++ b/meta-oe/recipes-devtools/nodejs/nodejs_22.22.3.bb
@@ -31,9 +31,6 @@ SRC_URI = "https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \
31 file://0001-positional-args.patch \ 31 file://0001-positional-args.patch \
32 file://0001-custom-env.patch \ 32 file://0001-custom-env.patch \
33 file://0001-build-remove-redundant-mXX-flags-for-V8.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 \ 34 file://run-ptest \
38 " 35 "
39SRC_URI:append:class-target = " \ 36SRC_URI:append:class-target = " \
@@ -42,7 +39,7 @@ SRC_URI:append:class-target = " \
42SRC_URI:append:toolchain-clang:powerpc64le = " \ 39SRC_URI:append:toolchain-clang:powerpc64le = " \
43 file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \ 40 file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \
44 " 41 "
45SRC_URI[sha256sum] = "b6bedd3a8cacd5df7df015a5088264b12c74a277ba60684cb9642ae8eb743132" 42SRC_URI[sha256sum] = "f3e6a578db1ab335a4a72785c1e87ad18a2cf6d2fc25747a1d741fb34af0bd0f"
46 43
47S = "${UNPACKDIR}/node-v${PV}" 44S = "${UNPACKDIR}/node-v${PV}"
48 45