tags 648741 + pending
thanks

Dear maintainer,

I've prepared an NMU for libgii (versioned as 1:1.0.2-4.1) and
uploaded it to DELAYED/7. Please feel free to tell me if I
should delay it longer. The fix is quite non-intrusive and is
only enabled for armhf. It's tested not to break amd64 builds
and operation. If you would like to check the patch more, I
could cancel or delay the NMU more, but please have in mind
that the package forbids the building of vlc on armhf right now.

Regards.

Konstantinos

diff -u libgii-1.0.2/debian/rules libgii-1.0.2/debian/rules
--- libgii-1.0.2/debian/rules
+++ libgii-1.0.2/debian/rules
@@ -2,6 +2,7 @@
 
 include /usr/share/quilt/quilt.make
 
+DEB_HOST_ARCH   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
@@ -17,6 +18,10 @@
 	CXXFLAGS += -O2
 endif
 
+ifneq (,$(findstring armhf,$(DEB_HOST_ARCH)))
+	CFLAGS += -DHAVE_GCC_ATOMICS
+endif
+
 configure: patch configure-stamp
 configure-stamp:
 	dh_testdir
diff -u libgii-1.0.2/debian/changelog libgii-1.0.2/debian/changelog
--- libgii-1.0.2/debian/changelog
+++ libgii-1.0.2/debian/changelog
@@ -1,3 +1,9 @@
+libgii (1:1.0.2-4.1) unstable; urgency=low
+
+  * NMU, add support for gcc atomics, enable it on armhf. (Closes: #648741)
+
+ -- Konstantinos Margaritis <[email protected]>  Wed, 11 Jan 2012 23:16:48 +0000
+
 libgii (1:1.0.2-4) unstable; urgency=low
 
   * Add ggtick manpage. Thanks to Jonathan Wiltshire
diff -u libgii-1.0.2/debian/patches/series libgii-1.0.2/debian/patches/series
--- libgii-1.0.2/debian/patches/series
+++ libgii-1.0.2/debian/patches/series
@@ -2,0 +3 @@
+libgii_gccatomics.patch
only in patch2:
unchanged:
--- libgii-1.0.2.orig/debian/patches/libgii_gccatomics.patch
+++ libgii-1.0.2/debian/patches/libgii_gccatomics.patch
@@ -0,0 +1,58 @@
+diff -ruN libgii-1.0.2/gg/gglock.c libgii-1.0.2.armhf/gg/gglock.c
+--- libgii-1.0.2/gg/gglock.c	2004-03-08 08:36:28.000000000 +0200
++++ libgii-1.0.2.armhf/gg/gglock.c	2011-10-31 17:51:32.829637818 +0200
+@@ -90,7 +90,8 @@
+ 
+ void ggUnlock(void *lock)
+ {
+-	*((int*)lock) = 0;
++        int *lck = lock;
++        lockrelease(lck);
+ 
+ 	return;
+ }
+diff -ruN libgii-1.0.2/gg/gglock.h libgii-1.0.2.armhf/gg/gglock.h
+--- libgii-1.0.2/gg/gglock.h	2005-07-31 18:31:10.000000000 +0300
++++ libgii-1.0.2.armhf/gg/gglock.h	2011-10-31 17:51:23.719633940 +0200
+@@ -32,6 +32,33 @@
+ 
+ #ifdef __GNUC__
+ 
++#ifdef HAVE_GCC_ATOMICS
++
++static inline int
++testandset(int *lock)
++{
++	int ret;
++
++	ret = __sync_lock_test_and_set(lock, 1);
++
++	return ret;
++}
++
++static inline int
++lockrelease(int *lock)
++{
++        __sync_lock_release(lock);
++}
++#define HAVE_TESTANDSET
++
++#else // HAVE_GCC_ATOMICS
++
++static inline int
++lockrelease(int *lock)
++{
++        *lock = 0;
++}
++
+ #if	defined(__i386__) || defined(__i386) || defined(i386) || \
+ 	defined(__i486__) || defined(__i486) || defined(i486) || \
+ 	defined(__i586__) || defined(__i586) || defined(i586) || \
+@@ -185,7 +212,7 @@
+ }
+ #define HAVE_TESTANDSET
+ #endif /* Supported platforms */
+-
++#endif /* HAVE_GCC_ATOMICS */
+ #endif /* __GNUC__ */
+ 

Reply via email to