diff --git a/libatomic_ops-ppc64.patch b/libatomic_ops-ppc64.patch new file mode 100644 index 0000000..fb449d6 --- /dev/null +++ b/libatomic_ops-ppc64.patch @@ -0,0 +1,21 @@ +Force AO_load() to map to AO_load_acquire() for powerpc. The +AO_load_acquire() function includes isync instructions that +are critical for proper behavior on power system. + + +Signed-Off-By: Will Schmidt + + +Index: libatomic_ops-7.2/src/atomic_ops/sysdeps/gcc/powerpc.h +=================================================================== +--- libatomic_ops-7.2.orig/src/atomic_ops/sysdeps/gcc/powerpc.h ++++ libatomic_ops-7.2/src/atomic_ops/sysdeps/gcc/powerpc.h +@@ -32,6 +32,8 @@ + + #include "../all_aligned_atomic_load_store.h" + ++#define AO_load(addr) AO_load_acquire(addr) ++ + #include "../test_and_set_t_is_ao_t.h" + /* There seems to be no byte equivalent of lwarx, so this */ + /* may really be what we want, at least in the 32-bit case. */ diff --git a/libatomic_ops-ppc64le.patch b/libatomic_ops-ppc64le.patch deleted file mode 100644 index efad6e6..0000000 --- a/libatomic_ops-ppc64le.patch +++ /dev/null @@ -1,65 +0,0 @@ -From: Dinar Valeev -Date: 2013-12-03 00:56:33.586516619 +0100 - -Index: libatomic_ops-7.2/src/atomic_ops.h -=================================================================== ---- libatomic_ops-7.2.orig/src/atomic_ops.h -+++ libatomic_ops-7.2/src/atomic_ops.h -@@ -241,7 +241,7 @@ - # include "atomic_ops/sysdeps/gcc/m68k.h" - # endif /* __m68k__ */ - # if defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) \ -- || defined(__powerpc64__) || defined(__ppc64__) -+ || defined(__powerpc64__) ||defined(__powerpc64le__) || defined(__ppc64__) - # include "atomic_ops/sysdeps/gcc/powerpc.h" - # endif /* __powerpc__ */ - # if defined(__aarch64__) -Index: libatomic_ops-7.2/src/atomic_ops/sysdeps/gcc/powerpc.h -=================================================================== ---- libatomic_ops-7.2.orig/src/atomic_ops/sysdeps/gcc/powerpc.h -+++ libatomic_ops-7.2/src/atomic_ops/sysdeps/gcc/powerpc.h -@@ -71,7 +71,7 @@ AO_INLINE AO_t - AO_load_acquire(const volatile AO_t *addr) - { - AO_t result; --#if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__) -+#if defined(__powerpc64__) || defined(__powerpc64le__) || defined(__ppc64__) || defined(__64BIT__) - __asm__ __volatile__ ( - "ld%U1%X1 %0,%1\n" - "cmpw %0,%0\n" -@@ -110,7 +110,7 @@ AO_store_release(volatile AO_t *addr, AO - /* only cost us a load immediate instruction. */ - AO_INLINE AO_TS_VAL_t - AO_test_and_set(volatile AO_TS_t *addr) { --#if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__) -+#if defined(__powerpc64__) || defined(__powerpc64le__)|| defined(__ppc64__) || defined(__64BIT__) - /* Completely untested. And we should be using smaller objects anyway. */ - unsigned long oldval; - unsigned long temp = 1; /* locked value */ -@@ -173,7 +173,7 @@ AO_INLINE int - AO_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val) { - AO_t oldval; - int result = 0; --#if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__) -+#if defined(__powerpc64__) || defined(__powerpc64le__)|| defined(__ppc64__) || defined(__64BIT__) - /* FIXME: Completely untested. */ - __asm__ __volatile__( - "1:ldarx %0,0,%2\n" /* load and reserve */ -@@ -232,7 +232,7 @@ AO_INLINE AO_t - AO_fetch_and_add(volatile AO_t *addr, AO_t incr) { - AO_t oldval; - AO_t newval; --#if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__) -+#if defined(__powerpc64__) || defined(__powerpc64le__)|| defined(__ppc64__) || defined(__64BIT__) - /* FIXME: Completely untested. */ - __asm__ __volatile__( - "1:ldarx %0,0,%2\n" /* load and reserve */ -@@ -281,7 +281,7 @@ AO_fetch_and_add_full(volatile AO_t *add - } - #define AO_HAVE_fetch_and_add_full - --#if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__) -+#if defined(__powerpc64__) || defined(__powerpc64le__) || defined(__ppc64__) || defined(__64BIT__) - #else - # include "../ao_t_is_int.h" - #endif diff --git a/libatomic_ops.changes b/libatomic_ops.changes index 8f43253..9373bb0 100644 --- a/libatomic_ops.changes +++ b/libatomic_ops.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Mon Feb 10 18:39:57 UTC 2014 - dvaleev@suse.com + +- Drop incorrect ppc64le patch +- Force AO_load() to map to AO_load_acquire() for powerpc + +- added patches: + * libatomic_ops-ppc64.patch +- removed patches: + * libatomic_ops-ppc64le.patch + ------------------------------------------------------------------- Mon Dec 2 21:00:35 UTC 2013 - dvaleev@suse.com diff --git a/libatomic_ops.spec b/libatomic_ops.spec index 159cc21..b0bf44b 100644 --- a/libatomic_ops.spec +++ b/libatomic_ops.spec @@ -1,7 +1,7 @@ # # spec file for package libatomic_ops # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,7 +26,7 @@ Url: http://www.hpl.hp.com/research/linux/atomic_ops/ Source: http://www.hpl.hp.com/research/linux/atomic_ops/download/libatomic_ops-%version.tar.gz Patch1: libatomic_ops-aarch64.patch -Patch2: libatomic_ops-ppc64le.patch +Patch2: libatomic_ops-ppc64.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake @@ -54,7 +54,8 @@ that involves minimum overhead across a variety of architectures. %prep %setup -qn %name-7.2 -%patch -P 1 -P 2 -p1 +%patch1 -p1 +%patch2 -p1 %build autoreconf -fi