1From cb190801706da046823c74f89472af83ff947ce1 Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Sat, 17 Aug 2019 22:25:06 +0200
4Subject: [PATCH] src/event/meson.build: add atomic dependency for sparc
5
6Linking with libatomic is needed on sparc otherwise build fails on:
7/usr/lfs/v0/rc-buildroot-test/scripts/instance-0/output/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: src/event/libevent.a(MaskMonitor.cxx.o): undefined reference to symbol '__atomic_fetch_or_4@@LIBATOMIC_1.0'
8
9Fixes:
10 - http://autobuild.buildroot.org/results/7a9fdb7e323892fb6ed85a2441054303e889c089
11
12Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
13[Upstream status: not sent (the same kind of patch for ncmpc was
14refused: https://github.com/MusicPlayerDaemon/ncmpc/pull/45)]
15---
16 src/event/meson.build | 4 ++++
17 1 file changed, 4 insertions(+)
18
19diff --git a/src/event/meson.build b/src/event/meson.build
20index bc13bbcd2..88370c03a 100644
21--- a/src/event/meson.build
22+++ b/src/event/meson.build
23@@ -21,9 +21,13 @@ event = static_library(
24   ],
25 )
26
27+# Needed on sparc
28+atomic_dep = c_compiler.find_library('atomic', required: false)
29+
30 event_dep = declare_dependency(
31   link_with: event,
32   dependencies: [
33+    atomic_dep,
34     thread_dep,
35     system_dep,
36     boost_dep,
37--
382.20.1
39
40