diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-04-20 15:59:40 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-04-21 08:27:01 -0700 |
commit | 37e0b6152c3347507d5efb20b6b161e9d84bca87 (patch) | |
tree | 4cdaddd076f7b91e080d4a38a2330a4fb40bbd15 | |
parent | 2f365001e24bd859a3bfc6d234e402c6f9224542 (diff) | |
download | meta-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.patch | 21 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs_14.16.1.bb | 5 |
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 @@ | |||
1 | Link mksnapshot with libatomic on x86 | ||
2 | |||
3 | Clang-12 on x86 emits atomic builtins | ||
4 | |||
5 | Fixes | ||
6 | | module-compiler.cc:(.text._ZN2v88internal4wasm12_GLOBAL__N_123ExecuteCompilationUnitsERKSt10shared_ptrINS2_22BackgroundCompileTokenEEPNS0_8CountersEiNS2_19CompileBaselineOnlyE+0x558): un | ||
7 | defined reference to `__atomic_load' | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | Signed-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 \ | |||
27 | SRC_URI_append_class-target = " \ | 27 | SRC_URI_append_class-target = " \ |
28 | file://0002-Using-native-binaries.patch \ | 28 | file://0002-Using-native-binaries.patch \ |
29 | " | 29 | " |
30 | SRC_URI_append_toolchain-clang_x86 = " \ | ||
31 | file://libatomic.patch \ | ||
32 | " | ||
30 | SRC_URI[sha256sum] = "e44adbbed6756c2c1a01258383e9f00df30c147b36e438f6369b5ef1069abac3" | 33 | SRC_URI[sha256sum] = "e44adbbed6756c2c1a01258383e9f00df30c147b36e438f6369b5ef1069abac3" |
31 | 34 | ||
32 | S = "${WORKDIR}/node-v${PV}" | 35 | S = "${WORKDIR}/node-v${PV}" |
@@ -123,6 +126,8 @@ python do_create_v8_qemu_wrapper () { | |||
123 | do_create_v8_qemu_wrapper[dirs] = "${B}" | 126 | do_create_v8_qemu_wrapper[dirs] = "${B}" |
124 | addtask create_v8_qemu_wrapper after do_configure before do_compile | 127 | addtask create_v8_qemu_wrapper after do_configure before do_compile |
125 | 128 | ||
129 | LDFLAGS_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 |
127 | do_configure () { | 132 | do_configure () { |
128 | export LD="${CXX}" | 133 | export LD="${CXX}" |