[directfb] Fix build on ARM
Nicolas Chauvet
kwizart at fedoraproject.org
Fri Apr 27 20:35:38 UTC 2012
commit 43ff2fa04ba0f602aa32abd1f7341ba4e3870444
Author: Nicolas Chauvet <kwizart at gmail.com>
Date: Fri Apr 27 22:34:37 2012 +0200
Fix build on ARM
DirectFB-1.5.3-backport-fix_arm.patch | 39 +++++++++++++++++++++++++++++++++
directfb.spec | 17 +++++++++++--
2 files changed, 53 insertions(+), 3 deletions(-)
---
diff --git a/DirectFB-1.5.3-backport-fix_arm.patch b/DirectFB-1.5.3-backport-fix_arm.patch
new file mode 100644
index 0000000..44d8957
--- /dev/null
+++ b/DirectFB-1.5.3-backport-fix_arm.patch
@@ -0,0 +1,39 @@
+diff -up DirectFB-1.5.3/lib/direct/atomic.h.fix_arm DirectFB-1.5.3/lib/direct/atomic.h
+--- DirectFB-1.5.3/lib/direct/atomic.h.fix_arm 2011-07-31 20:51:06.000000000 +0200
++++ DirectFB-1.5.3/lib/direct/atomic.h 2012-04-27 18:28:39.117537143 +0200
+@@ -185,7 +185,7 @@
+
+ #if defined(ARCH_ARM) && !defined(ARCH_IWMMXT)
+
+-static inline int _D__atomic_cmpxchg(volatile int *ptr, int old, int new)
++static inline int _D__atomic_cmpxchg(volatile int *ptr, int old, int _new)
+ {
+ unsigned long oldval, res;
+
+@@ -196,7 +196,7 @@ static inline int _D__atomic_cmpxchg(vol
+ "teq %1, %3\n"
+ "strexeq %0, %4, [%2]\n"
+ : "=&r" (res), "=&r" (oldval)
+- : "r" (ptr), "Ir" (old), "r" (new)
++ : "r" (ptr), "Ir" (old), "r" (_new)
+ : "cc");
+ } while (res);
+
+@@ -237,7 +237,7 @@ static inline int _D__atomic_add_return(
+ }
+
+ #define D_SYNC_ADD_AND_FETCH( ptr, value ) \
+- (_D__atomic_add_return( (int) (value), (void*) (ptr) ))
++ (_D__atomic_add_return( (int) (value), (volatile int*) (ptr) ))
+
+ #endif
+
+@@ -308,7 +308,7 @@ static inline int _D__atomic_add_return(
+ }
+
+ #define D_SYNC_ADD_AND_FETCH( ptr, value ) \
+- (_D__atomic_add_return( (int) (value), (void*) (ptr) ))
++ (_D__atomic_add_return( (int) (value), (volatile int*) (ptr) ))
+
+ #endif
+
diff --git a/directfb.spec b/directfb.spec
index 42abec6..9660676 100644
--- a/directfb.spec
+++ b/directfb.spec
@@ -4,7 +4,7 @@
Summary: Graphics abstraction library for the Linux Framebuffer Device
Name: directfb
Version: %{major_ver}%{minor_ver}
-Release: 5%{?dist}
+Release: 6%{?dist}
Group: System Environment/Libraries
License: LGPLv2+
URL: http://www.directfb.org/
@@ -13,9 +13,12 @@ Patch0: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/DirectF
Patch1: DirectFB-1.2.8-tweak.patch
Patch2: DirectFB-1.5.3-fix_v4l1.patch
Patch3: DirectFB-1.5.3-lm.patch
+Patch4: DirectFB-1.5.3-backport-fix_arm.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-#BuildRequires: libtool
+%ifarch %{arm}
+BuildRequires: libtool
+%endif
BuildRequires: libpng-devel
BuildRequires: zlib-devel
@@ -72,6 +75,7 @@ Development files for DirectFB.
%patch1 -p1 -b .tweak
%patch2 -p1 -b .fix_v4l1
%patch3 -p1 -b .lm
+%patch4 -p1
#Disable ppc asm since compilation fails (and it seems better to use glibc)
sed -i.noppcasm -e 's/want_ppcasm=yes/want_ppcasm=no/'g configure.in configure
@@ -87,7 +91,11 @@ done
#Remove old headers
rm interfaces/IDirectFBVideoProvider/{videodev.h,videodev2.h}
-
+%ifarch %{arm}
+#davinci no headers
+sed -i -e 's/checkfor_davinci=.*/checkfor_davinci=no/g' configure.in
+autoreconf -vif
+%endif
%build
%configure \
@@ -210,6 +218,9 @@ make check
%changelog
+* Fri Apr 27 2012 Nicolas Chauvet <kwizart at gmail.com> - 1.5.3-6
+- Backport fix for ARM
+
* Thu Apr 26 2012 Nicolas Chauvet <kwizart at gmail.com> - 1.5.3-5
- Fix rhbz#781874 - MMX is selectable at runtime
More information about the scm-commits
mailing list