summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-04-20 15:59:40 -0700
committerKhem Raj <raj.khem@gmail.com>2021-04-21 08:27:01 -0700
commit37e0b6152c3347507d5efb20b6b161e9d84bca87 (patch)
tree4cdaddd076f7b91e080d4a38a2330a4fb40bbd15
parent2f365001e24bd859a3bfc6d234e402c6f9224542 (diff)
downloadmeta-openembedded-37e0b6152c3347507d5efb20b6b161e9d84bca87.tar.gz
nodejs: Fix build with clang for x86 target
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/nodejs/nodejs/libatomic.patch21
-rw-r--r--meta-oe/recipes-devtools/nodejs/nodejs_14.16.1.bb5
2 files changed, 26 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/libatomic.patch b/meta-oe/recipes-devtools/nodejs/nodejs/libatomic.patch
new file mode 100644
index 000000000..cdf6bc8e2
--- /dev/null
+++ b/meta-oe/recipes-devtools/nodejs/nodejs/libatomic.patch
@@ -0,0 +1,21 @@
1Link mksnapshot with libatomic on x86
2
3Clang-12 on x86 emits atomic builtins
4
5Fixes
6| module-compiler.cc:(.text._ZN2v88internal4wasm12_GLOBAL__N_123ExecuteCompilationUnitsERKSt10shared_ptrINS2_22BackgroundCompileTokenEEPNS0_8CountersEiNS2_19CompileBaselineOnlyE+0x558): un
7defined reference to `__atomic_load'
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11
12--- a/tools/v8_gypfiles/v8.gyp
13+++ b/tools/v8_gypfiles/v8.gyp
14@@ -1336,6 +1336,7 @@
15 {
16 'target_name': 'mksnapshot',
17 'type': 'executable',
18+ 'libraries': [ '-latomic' ],
19 'dependencies': [
20 'v8_base_without_compiler',
21 'v8_compiler_for_mksnapshot',
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_14.16.1.bb b/meta-oe/recipes-devtools/nodejs/nodejs_14.16.1.bb
index 9580ef638..2953e9740 100644
--- a/meta-oe/recipes-devtools/nodejs/nodejs_14.16.1.bb
+++ b/meta-oe/recipes-devtools/nodejs/nodejs_14.16.1.bb
@@ -27,6 +27,9 @@ SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \
27SRC_URI_append_class-target = " \ 27SRC_URI_append_class-target = " \
28 file://0002-Using-native-binaries.patch \ 28 file://0002-Using-native-binaries.patch \
29 " 29 "
30SRC_URI_append_toolchain-clang_x86 = " \
31 file://libatomic.patch \
32 "
30SRC_URI[sha256sum] = "e44adbbed6756c2c1a01258383e9f00df30c147b36e438f6369b5ef1069abac3" 33SRC_URI[sha256sum] = "e44adbbed6756c2c1a01258383e9f00df30c147b36e438f6369b5ef1069abac3"
31 34
32S = "${WORKDIR}/node-v${PV}" 35S = "${WORKDIR}/node-v${PV}"
@@ -123,6 +126,8 @@ python do_create_v8_qemu_wrapper () {
123do_create_v8_qemu_wrapper[dirs] = "${B}" 126do_create_v8_qemu_wrapper[dirs] = "${B}"
124addtask create_v8_qemu_wrapper after do_configure before do_compile 127addtask create_v8_qemu_wrapper after do_configure before do_compile
125 128
129LDFLAGS_append_x86 = " -latomic"
130
126# Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi 131# Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi
127do_configure () { 132do_configure () {
128 export LD="${CXX}" 133 export LD="${CXX}"