1 |
ford_prefect 10/11/27 06:52:54 |
2 |
|
3 |
Added: pulseaudio-0.9.21-armv5-build-fix.patch |
4 |
Log: |
5 |
Add a patch to fix compilation on ARMv5. Adding to stable candidate and 2 most recent ebuilds. 0.9.21.2 and 0.9.21.2-r1 can be removed after a newer version is keyworded on arm. |
6 |
|
7 |
(Portage version: 2.2.0_alpha4/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 media-sound/pulseaudio/files/pulseaudio-0.9.21-armv5-build-fix.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/pulseaudio/files/pulseaudio-0.9.21-armv5-build-fix.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/pulseaudio/files/pulseaudio-0.9.21-armv5-build-fix.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: pulseaudio-0.9.21-armv5-build-fix.patch |
16 |
=================================================================== |
17 |
From e5b136fc0fde751df3a94cd64855a74732dd4cc7 Mon Sep 17 00:00:00 2001 |
18 |
From: Arun Raghavan <arun.raghavan@××××××××××××.uk> |
19 |
Date: Fri, 26 Nov 2010 11:55:57 +0530 |
20 |
Subject: [PATCH] volume: Add explicit checks for ARMv6 instructions |
21 |
|
22 |
This ensures that the build does not fail if the ssat and pkhbt |
23 |
instructions are not available (armv5te and below). |
24 |
|
25 |
Fixes: http://www.pulseaudio.org/ticket/790 |
26 |
--- |
27 |
configure.ac | 33 ++++++++++++++++++++++++++++++++- |
28 |
src/pulsecore/svolume_arm.c | 8 ++++---- |
29 |
2 files changed, 36 insertions(+), 5 deletions(-) |
30 |
|
31 |
diff --git a/configure.ac b/configure.ac |
32 |
index 7ab42dc..3df8c6b 100644 |
33 |
--- a/configure.ac |
34 |
+++ b/configure.ac |
35 |
@@ -230,7 +230,7 @@ else |
36 |
[pulseaudio_cv_support_arm_atomic_ops=no]) |
37 |
]) |
38 |
AS_IF([test "$pulseaudio_cv_support_arm_atomic_ops" = "yes"], [ |
39 |
- AC_DEFINE([ATOMIC_ARM_INLINE_ASM], 1, [Have ARMv6 instructions.]) |
40 |
+ AC_DEFINE([ATOMIC_ARM_INLINE_ASM], 1, [Have ARM atomic instructions.]) |
41 |
need_libatomic_ops=no |
42 |
]) |
43 |
fi |
44 |
@@ -249,6 +249,37 @@ else |
45 |
esac |
46 |
fi |
47 |
|
48 |
+# If we're on ARM, check for the ARMV6 instructions we need */ |
49 |
+case $host in |
50 |
+ arm*) |
51 |
+ AC_CACHE_CHECK([support for required armv6 instructions], |
52 |
+ pulseaudio_cv_support_armv6, |
53 |
+ [AC_COMPILE_IFELSE( |
54 |
+ AC_LANG_PROGRAM([], |
55 |
+ [[volatile int a = -60000, b = 0xaaaabbbb, c = 0xccccdddd; |
56 |
+ asm volatile ("ldr r0, %2 \n" |
57 |
+ "ldr r2, %3 \n" |
58 |
+ "ldr r3, %4 \n" |
59 |
+ "ssat r1, #8, r0 \n" |
60 |
+ "str r1, %0 \n" |
61 |
+ "pkhbt r1, r3, r2, LSL #8 \n" |
62 |
+ "str r1, %1 \n" |
63 |
+ : "=m" (a), "=m" (b) |
64 |
+ : "m" (a), "m" (b), "m" (c) |
65 |
+ : "r0", "r1", "r2", "r3", "cc"); |
66 |
+ return (a == -128 && b == 0xaabbdddd) ? 0 : -1; |
67 |
+ ]]), |
68 |
+ [pulseaudio_cv_support_armv6=yes], |
69 |
+ [pulseaudio_cv_support_armv6=no]) |
70 |
+ ]) |
71 |
+ AS_IF([test "$pulseaudio_cv_support_armv6" = "yes"], [ |
72 |
+ AC_DEFINE([HAVE_ARMV6], 1, [Have ARMv6 instructions.]) |
73 |
+ ]) |
74 |
+ ;; |
75 |
+ *) |
76 |
+ ;; |
77 |
+esac |
78 |
+ |
79 |
CC_CHECK_TLS |
80 |
|
81 |
AC_CACHE_CHECK([whether $CC knows _Bool], |
82 |
diff --git a/src/pulsecore/svolume_arm.c b/src/pulsecore/svolume_arm.c |
83 |
index fdd8f09..3973e51 100644 |
84 |
--- a/src/pulsecore/svolume_arm.c |
85 |
+++ b/src/pulsecore/svolume_arm.c |
86 |
@@ -35,7 +35,7 @@ |
87 |
#include "sample-util.h" |
88 |
#include "endianmacros.h" |
89 |
|
90 |
-#if defined (__arm__) |
91 |
+#if defined (__arm__) && defined (HAVE_ARMV6) |
92 |
|
93 |
#define MOD_INC() \ |
94 |
" subs r0, r6, %2 \n\t" \ |
95 |
@@ -182,11 +182,11 @@ static void run_test (void) { |
96 |
} |
97 |
#endif |
98 |
|
99 |
-#endif /* defined (__arm__) */ |
100 |
+#endif /* defined (__arm__) && defined (HAVE_ARMV6) */ |
101 |
|
102 |
|
103 |
void pa_volume_func_init_arm (pa_cpu_arm_flag_t flags) { |
104 |
-#if defined (__arm__) |
105 |
+#if defined (__arm__) && defined (HAVE_ARMV6) |
106 |
pa_log_info("Initialising ARM optimized functions."); |
107 |
|
108 |
#ifdef RUN_TEST |
109 |
@@ -194,5 +194,5 @@ void pa_volume_func_init_arm (pa_cpu_arm_flag_t flags) { |
110 |
#endif |
111 |
|
112 |
pa_set_volume_func (PA_SAMPLE_S16NE, (pa_do_volume_func_t) pa_volume_s16ne_arm); |
113 |
-#endif /* defined (__arm__) */ |
114 |
+#endif /* defined (__arm__) && defined (HAVE_ARMV6) */ |
115 |
} |
116 |
-- |
117 |
1.7.3.2 |