Tim Orling 143d18269c
nodejs: upgrade 22.22.3 -> 24.16.0 (LTS)
Add Node.js 24.16.0 [1] recipe based on 22.22.3. Patches reviewed against
the 24.15.0 source tree and rebased where needed:

- 0001: rebased for Makefile changes (common_node.gypi removed, line
  offsets shifted); merged with Disable-running-gyp-files patch since
  both modify the same Makefile hunk. Remove deps/simdutf/simdutf.gyp;
  no longer vendored here.
- 0005: rebased for v8.gyp libatomic condition change (clang condition
  folded upstream, ppc removed)

- v24.16.0 bumps bundled llhttp to 9.3.1 (LLHTTP_VERSION_MAJOR/MINOR/PATCH
  = 9/3/1 in deps/llhttp/include/llhttp.h).

Five patches dropped as no longer needed:
- build-remove-redundant-mXX-flags-for-V8: backport already merged
  upstream in Node.js 24
- ppc64-Do-not-use-mminimal-toc-with-clang: Node.js 24 common.gypi
  already gates -mminimal-toc behind clang==0
- fix-arm-Neon-intrinsics-types: the v24.16.0 source already uses
  vandq_u8/vorrq_u8 and vshrn_n_u16(vreinterpretq_u16_u8(mask), 4).
- detect-aarch64-Neon-correctly:  #ifdef __ARM_NEON__ →
  #if defined(__ARM_NEON__) || defined(__ARM_NEON) — already present
  at lines 13 and 2628.
- llhttp-fix-NEON-header-value-__builtin_ctzll-undefin: wanted the
  match_mask == 0 guard around __builtin_ctzll — already present.
  "This patch can be dropped when nodejs updates its bundled llhttp
  to >= 9.3.1.")

Remaining 9 patches renumbered sequentially 0001-0009. All verified to
apply cleanly against the v24.16.0 source tarball.

NOTE: The "current" release is v26.2.0 [1], but this is not yet an LTS
      release. Application stacks frequently lag new releases, so
      it makes sense to have support for the v24 LTS release.

[1] https://nodejs.org/en/blog/release/v24.16.0
[2] https://nodejs.org/en/blog/release/v26.2.0

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-05-21 17:20:20 -07:00

96 lines
3.3 KiB
Diff

From 15e751e4b79475fb34e4b32a3ca54119b20c564a Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Sat, 17 Aug 2024 21:33:18 +0800
Subject: [PATCH] link libatomic for clang conditionally
Clang emits atomic builtin, explicitly link libatomic conditionally:
- For target build, always link -latomic for clang as usual
- For host build, if host and target have same bit width, cross compiling
is enabled, and host toolchain is gcc which does not link -latomic;
if host and target have different bit width, no cross compiling,
host build is the same with target build that requires to link
-latomic;
Fix:
|tmp-glibc/work/core2-64-wrs-linux/nodejs/20.13.0/node-v20.13.0/out/Release/node_js2c: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory
Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Added libatomic library explicitly to x86 targets.
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
node.gyp | 13 ++++++++++++-
tools/v8_gypfiles/v8.gyp | 29 ++++++++++++++++++++++++-----
2 files changed, 36 insertions(+), 6 deletions(-)
--- a/node.gyp
+++ b/node.gyp
@@ -503,7 +503,18 @@
],
}],
['OS=="linux" and clang==1', {
- 'libraries': ['-latomic'],
+ 'target_conditions': [
+ ['_toolset=="host"', {
+ 'conditions': [
+ ['"<!(echo $HOST_AND_TARGET_SAME_WIDTH)"=="0"', {
+ 'libraries': ['-latomic'],
+ }],
+ ],
+ }],
+ ['_toolset=="target"', {
+ 'libraries': ['-latomic'],
+ }],
+ ],
}],
],
},
--- a/tools/v8_gypfiles/v8.gyp
+++ b/tools/v8_gypfiles/v8.gyp
@@ -1324,10 +1324,24 @@
# Platforms that don't have Compare-And-Swap (CAS) support need to link atomic library
# to implement atomic memory access.
# Clang needs it for some atomic operations (https://clang.llvm.org/docs/Toolchain.html#atomics-library).
- ['(OS=="linux" and clang==1) or (v8_current_cpu in ["mips64", "mips64el", "arm", "riscv64", "loong64"])', {
- 'link_settings': {
- 'libraries': ['-latomic', ],
- },
+ ['(OS=="linux" and clang==1) or \
+ (v8_current_cpu in ["mips64", "mips64el", "arm", "riscv64", "loong64"])', {
+ 'target_conditions': [
+ ['_toolset=="host"', {
+ 'conditions': [
+ ['"<!(echo $HOST_AND_TARGET_SAME_WIDTH)"=="0"', {
+ 'link_settings': {
+ 'libraries': ['-latomic'],
+ },
+ }],
+ ],
+ }],
+ ['_toolset=="target"', {
+ 'link_settings': {
+ 'libraries': ['-latomic', ],
+ },
+ }],
+ ],
}],
],
}, # v8_base_without_compiler
@@ -1793,6 +1805,13 @@
['enable_lto=="true"', {
'ldflags': [ '-fno-lto' ],
}],
+ # For future patch-rebases: this hunk is in mksnapshot target.
+ # ia32 includes x86 also
+ ['v8_target_arch=="ia32"', {
+ 'link_settings': {
+ 'libraries': ['-latomic']
+ }
+ }],
],
}, # mksnapshot
{