summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2026-02-12 13:53:50 +0100
committerKhem Raj <raj.khem@gmail.com>2026-02-16 00:34:01 -0800
commitd3fbcf87008dbd88bbe62a013b759de46eb932bb (patch)
treef07d1f8f87db4dbf81789a54b1b67f894794de86
parent2296bdb6c1fa28f80761d9f119108568f9f00cda (diff)
downloadmeta-openembedded-d3fbcf87008dbd88bbe62a013b759de46eb932bb.tar.gz
nodejs: patch incorrect NEON intrinsics
The llhttp dependency of nodejs uses NEON intrinsics when they are available, however some of these calls are incorrect: they the call they use don't match the parameters passed, and so the compilation fail (unless the error is suppressed): | ../deps/llhttp/src/llhttp.c: In function 'llhttp__internal__run': | ../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 | 2645 | ); | | ^ | ../deps/llhttp/src/llhttp.c:2643:11: error: incompatible type for argument 1 of 'vandq_u16' | 2643 | vcgeq_u8(input, vdupq_n_u8(' ')), There is a patch upstream that fixes it (though it is not merged yet). This patch is a port of that fix. This allows us to remove the extra CFLAGS also from the recipe that suppressed this error. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-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_22.22.0.bb5
2 files changed, 60 insertions, 4 deletions
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
new file mode 100644
index 0000000000..ddbad575f0
--- /dev/null
+++ b/meta-oe/recipes-devtools/nodejs/nodejs/0001-fix-arm-Neon-intrinsics-types.patch
@@ -0,0 +1,59 @@
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_22.22.0.bb b/meta-oe/recipes-devtools/nodejs/nodejs_22.22.0.bb
index afe3d2ddf1..960c0b1e6d 100644
--- a/meta-oe/recipes-devtools/nodejs/nodejs_22.22.0.bb
+++ b/meta-oe/recipes-devtools/nodejs/nodejs_22.22.0.bb
@@ -31,6 +31,7 @@ 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 \
34 file://run-ptest \ 35 file://run-ptest \
35 " 36 "
36SRC_URI:append:class-target = " \ 37SRC_URI:append:class-target = " \
@@ -46,10 +47,6 @@ S = "${UNPACKDIR}/node-v${PV}"
46# v8 errors out if you have set CCACHE 47# v8 errors out if you have set CCACHE
47CCACHE = "" 48CCACHE = ""
48 49
49# Use '-flax-vector-conversions' to permit conversions between vectors
50# with differing element types or numbers of subparts
51CFLAGS:append:toolchain-gcc:arm = " -flax-vector-conversions"
52
53def map_nodejs_arch(a, d): 50def map_nodejs_arch(a, d):
54 import re 51 import re
55 52