diff options
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs/0001-detect-aarch64-Neon-correctly.patch | 51 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs_22.22.0.bb | 1 |
2 files changed, 52 insertions, 0 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 new file mode 100644 index 0000000000..15de2c1119 --- /dev/null +++ b/meta-oe/recipes-devtools/nodejs/nodejs/0001-detect-aarch64-Neon-correctly.patch | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | From 41ec2d5302b77be27ca972102c29ce12471ed4b0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Thu, 12 Feb 2026 11:09:44 +0100 | ||
| 4 | Subject: [PATCH 2/2] detect aarch64 Neon correctly | ||
| 5 | |||
| 6 | The llhttp vendored dependency of nodejs takes advantage of Arm NEON | ||
| 7 | instructions when they are available, however they are detected by | ||
| 8 | checking for an outdated CPU feature macro: it checks for __ARM_NEON__, | ||
| 9 | however it is not defined by new compilers for aarch64, rather they | ||
| 10 | set __ARM_NEON. The Arm C extension guide[1] refers to __ARM_NEON macro | ||
| 11 | aswell. | ||
| 12 | |||
| 13 | This patch changes the detection to check for both macros when detecting | ||
| 14 | the availability of NEON instructions. | ||
| 15 | |||
| 16 | The code this patch modifies is generated, so the patch itself isn't | ||
| 17 | suitable for upstream submission, as the root cause of the error is | ||
| 18 | in the generator itself. A PR has been submitted[2] to the generator | ||
| 19 | project 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 | |||
| 24 | Upstream-Status: Inappropriate [see above] | ||
| 25 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 26 | --- | ||
| 27 | deps/llhttp/src/llhttp.c | 4 ++-- | ||
| 28 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 29 | |||
| 30 | diff --git a/deps/llhttp/src/llhttp.c b/deps/llhttp/src/llhttp.c | ||
| 31 | index 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_22.22.0.bb b/meta-oe/recipes-devtools/nodejs/nodejs_22.22.0.bb index 960c0b1e6d..05fa608047 100644 --- a/meta-oe/recipes-devtools/nodejs/nodejs_22.22.0.bb +++ b/meta-oe/recipes-devtools/nodejs/nodejs_22.22.0.bb | |||
| @@ -32,6 +32,7 @@ SRC_URI = "https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \ | |||
| 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://0001-fix-arm-Neon-intrinsics-types.patch \ |
| 35 | file://0001-detect-aarch64-Neon-correctly.patch \ | ||
| 35 | file://run-ptest \ | 36 | file://run-ptest \ |
| 36 | " | 37 | " |
| 37 | SRC_URI:append:class-target = " \ | 38 | SRC_URI:append:class-target = " \ |
