PKGBUILDs/extra/pipewire/0001-atomic.patch

53 lines
1.8 KiB
Diff
Raw Normal View History

2020-08-15 03:30:50 +00:00
From ff849ed1b0d254afa4dd591ca01d8d74c03344ec Mon Sep 17 00:00:00 2001
2020-03-12 00:53:10 +00:00
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Wed, 11 Mar 2020 07:28:28 -0600
2020-05-13 13:08:09 +00:00
Subject: [PATCH] atomic
2020-03-12 00:53:10 +00:00
---
pipewire-jack/src/meson.build | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/pipewire-jack/src/meson.build b/pipewire-jack/src/meson.build
2020-08-15 03:30:50 +00:00
index a052eaa8..1f08f0a5 100644
2020-03-12 00:53:10 +00:00
--- a/pipewire-jack/src/meson.build
+++ b/pipewire-jack/src/meson.build
2020-08-15 03:30:50 +00:00
@@ -33,13 +33,34 @@ configure_file(input : 'pw-jack.in',
configuration : tools_config,
2020-05-01 12:49:27 +00:00
install_dir : pipewire_bindir)
2020-03-12 00:53:10 +00:00
+# Check for GCC style atomics
+dep_atomic = declare_dependency()
+
+if cc.compiles('int main() { int n; return __atomic_load_n(&n, __ATOMIC_ACQUIRE); }',
+ name : 'GCC atomic builtins')
+ # Not all atomic calls can be turned into lock-free instructions, in which
+ # GCC will make calls into the libatomic library. Check whether we need to
+ # link with -latomic.
+ #
+ # This can happen for 64-bit atomic operations on 32-bit architectures such
+ # as ARM.
+ if not cc.links('''#include <stdint.h>
+ int main() {
+ uint64_t n;
+ return (int)__atomic_load_n(&n, __ATOMIC_ACQUIRE);
+ }''',
+ name : 'GCC atomic builtins required -latomic')
+ dep_atomic = cc.find_library('atomic')
+ endif
+endif
+
2020-05-01 12:49:27 +00:00
pipewire_jack = shared_library('jack',
2020-03-12 00:53:10 +00:00
pipewire_jack_sources,
2020-05-01 12:49:27 +00:00
soversion : soversion,
version : libversion,
2020-03-12 00:53:10 +00:00
c_args : pipewire_jack_c_args,
include_directories : [configinc],
- dependencies : [pipewire_dep, jack_dep, mathlib],
+ dependencies : [pipewire_dep, jack_dep, mathlib, dep_atomic],
install : true,
2020-05-01 12:49:27 +00:00
install_dir : libjack_path,
2020-03-12 00:53:10 +00:00
)
--
2020-05-01 12:49:27 +00:00
2.26.2
2020-03-12 00:53:10 +00:00