summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/nodejs/nodejs-24/0005-libatomic.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-devtools/nodejs/nodejs-24/0005-libatomic.patch')
-rw-r--r--meta-oe/recipes-devtools/nodejs/nodejs-24/0005-libatomic.patch95
1 files changed, 0 insertions, 95 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs-24/0005-libatomic.patch b/meta-oe/recipes-devtools/nodejs/nodejs-24/0005-libatomic.patch
deleted file mode 100644
index a61b28f2f8..0000000000
--- a/meta-oe/recipes-devtools/nodejs/nodejs-24/0005-libatomic.patch
+++ /dev/null
@@ -1,95 +0,0 @@
1From 15e751e4b79475fb34e4b32a3ca54119b20c564a Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Sat, 17 Aug 2024 21:33:18 +0800
4Subject: [PATCH] link libatomic for clang conditionally
5
6Clang emits atomic builtin, explicitly link libatomic conditionally:
7- For target build, always link -latomic for clang as usual
8- For host build, if host and target have same bit width, cross compiling
9 is enabled, and host toolchain is gcc which does not link -latomic;
10 if host and target have different bit width, no cross compiling,
11 host build is the same with target build that requires to link
12 -latomic;
13
14Fix:
15|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
16
17Upstream-Status: Inappropriate [OE specific]
18
19Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
20
21Added libatomic library explicitly to x86 targets.
22
23Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
24---
25 node.gyp | 13 ++++++++++++-
26 tools/v8_gypfiles/v8.gyp | 29 ++++++++++++++++++++++++-----
27 2 files changed, 36 insertions(+), 6 deletions(-)
28
29--- a/node.gyp
30+++ b/node.gyp
31@@ -503,7 +503,18 @@
32 ],
33 }],
34 ['OS=="linux" and clang==1', {
35- 'libraries': ['-latomic'],
36+ 'target_conditions': [
37+ ['_toolset=="host"', {
38+ 'conditions': [
39+ ['"<!(echo $HOST_AND_TARGET_SAME_WIDTH)"=="0"', {
40+ 'libraries': ['-latomic'],
41+ }],
42+ ],
43+ }],
44+ ['_toolset=="target"', {
45+ 'libraries': ['-latomic'],
46+ }],
47+ ],
48 }],
49 ],
50 },
51--- a/tools/v8_gypfiles/v8.gyp
52+++ b/tools/v8_gypfiles/v8.gyp
53@@ -1324,10 +1324,24 @@
54 # Platforms that don't have Compare-And-Swap (CAS) support need to link atomic library
55 # to implement atomic memory access.
56 # Clang needs it for some atomic operations (https://clang.llvm.org/docs/Toolchain.html#atomics-library).
57- ['(OS=="linux" and clang==1) or (v8_current_cpu in ["mips64", "mips64el", "arm", "riscv64", "loong64"])', {
58- 'link_settings': {
59- 'libraries': ['-latomic', ],
60- },
61+ ['(OS=="linux" and clang==1) or \
62+ (v8_current_cpu in ["mips64", "mips64el", "arm", "riscv64", "loong64"])', {
63+ 'target_conditions': [
64+ ['_toolset=="host"', {
65+ 'conditions': [
66+ ['"<!(echo $HOST_AND_TARGET_SAME_WIDTH)"=="0"', {
67+ 'link_settings': {
68+ 'libraries': ['-latomic'],
69+ },
70+ }],
71+ ],
72+ }],
73+ ['_toolset=="target"', {
74+ 'link_settings': {
75+ 'libraries': ['-latomic', ],
76+ },
77+ }],
78+ ],
79 }],
80 ],
81 }, # v8_base_without_compiler
82@@ -1793,6 +1805,13 @@
83 ['enable_lto=="true"', {
84 'ldflags': [ '-fno-lto' ],
85 }],
86+ # For future patch-rebases: this hunk is in mksnapshot target.
87+ # ia32 includes x86 also
88+ ['v8_target_arch=="ia32"', {
89+ 'link_settings': {
90+ 'libraries': ['-latomic']
91+ }
92+ }],
93 ],
94 }, # mksnapshot
95 {