summaryrefslogtreecommitdiff
path: root/package/mpv
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-08-08 23:43:56 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-08-09 15:50:52 +0200
commitc0a5fdf188e2d474ff601b31f8b7551946553f14 (patch)
treeff9349f55c83988dba90854978f209a9f6dca7f0 /package/mpv
parentf1cbfeea95e6287c7a666aafc182ffa318eff262 (diff)
mpv: fix build on sparc
This commit adds a new patch for mpv that fixes the stdatomic detection logic so that it realizes linking against libatomic is needed on some architectures. This fixes the build of mpv on SPARC. The patch has been submitted upstream. Fixes: http://autobuild.buildroot.net/results/f607eed9a48c4ca00db43f9d2652e615b4bd7c93/ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/mpv')
-rw-r--r--package/mpv/0002-wscript-improve-stdatomic-check.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/package/mpv/0002-wscript-improve-stdatomic-check.patch b/package/mpv/0002-wscript-improve-stdatomic-check.patch
new file mode 100644
index 000000000..c2a307e9a
--- /dev/null
+++ b/package/mpv/0002-wscript-improve-stdatomic-check.patch
@@ -0,0 +1,47 @@
+From 5a635a0066b10d2ba25e0ce78cc57b2be619371c Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Mon, 8 Aug 2016 23:34:32 +0200
+Subject: [PATCH] wscript: improve stdatomic check
+
+The current stdatomic check verifies the availability of the function by
+calling atomic_load(). It also uses this test to check if linking
+against libatomic is needed or not.
+
+Unfortunately, on specific architectures (namely SPARC), using
+atomic_load() does *not* require linking against libatomic, while other
+atomic operations do. Due to this, mpv's wscript concludes that
+stdatomic is available, and that linking against libatomic is not
+needed, causing the following link failure:
+
+[190/190] Linking build/mpv
+audio/out/ao.c.13.o: In function `ao_query_and_reset_events':
+/home/peko/autobuild/instance-0/output/build/mpv-0.18.1/build/../audio/out/ao.c:399: undefined reference to `__atomic_fetch_and_4'
+
+In order to fix this, the stdatomic check is adjusted to call
+atomic_fetch_add() instead, which does require libatomic. Thanks to
+this, the wscript realizes that linking against libatomic is needed, and
+the build works fine.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+Submitted upstream: https://github.com/mpv-player/mpv/pull/3403
+
+ wscript | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/wscript b/wscript
+index a18df6f..4c49caf 100644
+--- a/wscript
++++ b/wscript
+@@ -154,7 +154,7 @@ main_dependencies = [
+ 'func': check_libs(['atomic'],
+ check_statement('stdatomic.h',
+ 'atomic_int_least64_t test = ATOMIC_VAR_INIT(123);'
+- 'int test2 = atomic_load(&test)'))
++ 'atomic_fetch_add(&test, 1)'))
+ }, {
+ 'name': 'atomic-builtins',
+ 'desc': 'compiler support for __atomic built-ins',
+--
+2.7.4
+