Add fix for x32 ABIs.
authorMike Frysinger <vapier@gentoo.org>
Fri, 9 Dec 2011 18:36:32 +0000 (18:36 +0000)
committerMike Frysinger <vapier@gentoo.org>
Fri, 9 Dec 2011 18:36:32 +0000 (18:36 +0000)
Package-Manager: portage-2.2.0_alpha79/cvs/Linux x86_64

dev-libs/libatomic_ops/ChangeLog
dev-libs/libatomic_ops/files/libatomic_ops-1.2-x32.patch [new file with mode: 0644]
dev-libs/libatomic_ops/libatomic_ops-1.2-r1.ebuild

index 90c6a6c62cc6ee88cb4d247f7c76fb8774749720..47bc0adde4ad81dd980b1911a439cc303df9106b 100644 (file)
@@ -1,6 +1,10 @@
 # ChangeLog for dev-libs/libatomic_ops
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/libatomic_ops/ChangeLog,v 1.25 2011/09/26 17:30:29 grobian Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/libatomic_ops/ChangeLog,v 1.26 2011/12/09 18:36:31 vapier Exp $
+
+  09 Dec 2011; Mike Frysinger <vapier@gentoo.org> libatomic_ops-1.2-r1.ebuild,
+  +files/libatomic_ops-1.2-x32.patch:
+  Add fix for x32 ABIs.
 
   26 Sep 2011; Fabian Groffen <grobian@gentoo.org> libatomic_ops-1.2-r1.ebuild:
   Marked ~x86-freebsd
diff --git a/dev-libs/libatomic_ops/files/libatomic_ops-1.2-x32.patch b/dev-libs/libatomic_ops/files/libatomic_ops-1.2-x32.patch
new file mode 100644 (file)
index 0000000..2edc695
--- /dev/null
@@ -0,0 +1,43 @@
+http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=e3a384578f677c05d812d99c2c92aa13670bd06a
+
+Upstream-Status: Pending
+
+Remove the `q' suffix on x86-64 atomic instructions.
+
+We don't need the `q' suffix on x86_64 atomic instructions for AO_t,
+which is defined as "unsigned long".  "unsigned long" is 32bit for x32
+and 64bit for x86-64. The register operand in x86-64 atomic instructions
+is sufficient to properly determine the register size.
+
+Received this patch from H.J. Lu <hjl.tools@gmail.com>
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/02
+
+--- libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/x86_64.h.x32  2005-09-28 17:16:38.000000000 -0700
++++ libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/x86_64.h      2011-12-02 09:29:54.265251875 -0800
+@@ -60,7 +60,7 @@ AO_fetch_and_add_full (volatile AO_t *p,
+ {
+   AO_t result;
+-  __asm__ __volatile__ ("lock; xaddq %0, %1" :
++  __asm__ __volatile__ ("lock; xadd %0, %1" :
+                       "=r" (result), "=m" (*p) : "0" (incr), "m" (*p)
+                       : "memory");
+   return result;
+@@ -111,7 +111,7 @@ AO_int_fetch_and_add_full (volatile unsi
+ AO_INLINE void
+ AO_or_full (volatile AO_t *p, AO_t incr)
+ {
+-  __asm__ __volatile__ ("lock; orq %1, %0" :
++  __asm__ __volatile__ ("lock; or %1, %0" :
+                       "=m" (*p) : "r" (incr), "m" (*p) : "memory");
+ }
+@@ -136,7 +136,7 @@ AO_compare_and_swap_full(volatile AO_t *
+                            AO_t old, AO_t new_val) 
+ {
+   char result;
+-  __asm__ __volatile__("lock; cmpxchgq %3, %0; setz %1"
++  __asm__ __volatile__("lock; cmpxchg %3, %0; setz %1"
+                      : "=m"(*addr), "=q"(result)
+                      : "m"(*addr), "r" (new_val), "a"(old) : "memory");
+   return (int) result;
index 00f2da99972be57b1ae43eb91f9e364ae33e8e9c..0b3792d1c2f38dfb0f09ecc38a5fbb08636d4869 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/libatomic_ops/libatomic_ops-1.2-r1.ebuild,v 1.18 2011/09/26 17:30:29 grobian Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/libatomic_ops/libatomic_ops-1.2-r1.ebuild,v 1.19 2011/12/09 18:36:31 vapier Exp $
 
 inherit eutils autotools
 
@@ -13,9 +13,6 @@ SLOT="0"
 KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
 IUSE=""
 
-DEPEND=""
-RDEPEND=""
-
 src_unpack(){
        unpack ${A}
        cd "${S}"
@@ -23,6 +20,7 @@ src_unpack(){
        epatch "${FILESDIR}"/${P}-ppc-asm.patch
        epatch "${FILESDIR}"/${P}-sh4.patch
        epatch "${FILESDIR}"/${P}-fix-makefile-am-generic.patch
+       epatch "${FILESDIR}"/${P}-x32.patch
        eautoreconf
 }