vapier      15/08/07 06:01:07

  Modified:             README.history
  Added:               
                        
00_all_0021-ia64-atomic.h-fix-atomic_exchange_and_add-64bit-hand.patch
  Log:
  fix from upstream for ia64 atomics

Revision  Changes    Path
1.5                  src/patchsets/glibc/2.21/README.history

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.21/README.history?rev=1.5&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.21/README.history?rev=1.5&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.21/README.history?r1=1.4&r2=1.5

Index: README.history
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/glibc/2.21/README.history,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- README.history      21 Jul 2015 03:48:57 -0000      1.4
+++ README.history      7 Aug 2015 06:01:07 -0000       1.5
@@ -1,3 +1,6 @@
+4              27 Jul 2015
+       + 00_all_0021-ia64-atomic.h-fix-atomic_exchange_and_add-64bit-hand.patch
+
 3              21 Jul 2015
        + 00_all_0017-CVE-2015-1781-resolv-nss_dns-dns-host.c-buffer-overf.patch
        + 00_all_0018-sparc-fix-sigaction-for-32bit-builds-BZ-18694.patch



1.1                  
src/patchsets/glibc/2.21/00_all_0021-ia64-atomic.h-fix-atomic_exchange_and_add-64bit-hand.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.21/00_all_0021-ia64-atomic.h-fix-atomic_exchange_and_add-64bit-hand.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.21/00_all_0021-ia64-atomic.h-fix-atomic_exchange_and_add-64bit-hand.patch?rev=1.1&content-type=text/plain

Index: 00_all_0021-ia64-atomic.h-fix-atomic_exchange_and_add-64bit-hand.patch
===================================================================
>From 43d7ce9238c59c61003994cb26eff4a6a072ebd5 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vap...@gentoo.org>
Date: Tue, 28 Jul 2015 02:19:49 -0400
Subject: [PATCH] ia64: atomic.h: fix atomic_exchange_and_add 64bit handling

Way back in 2005 the atomic_exchange_and_add function was cleaned up to
avoid the explicit size checking and instead let gcc handle things itself.
Unfortunately that change ended up leaving beyond a cast to int, even when
the incoming value was a long.  This has flown under the radar for a long
time due to the function not being heavily used in the tree (especially as
a full 64bit field), but a recent change to semaphores made some nptl tests
fail reliably.  This is due to the code packing two 32bit values into one
64bit variable (where the high 32bits contained the number of waiters), and
then the whole variable being atomically updated between threads.  On ia64,
that meant we never atomically updated the count, so sometimes the sem_post
would not wake up the waiters.

(cherry picked from commit cf31a2c79957936b60de34ea1e718e892baf669c)
(cherry picked from commit 978908245b2c0f759100708a9966649f7b273664)
---
 sysdeps/ia64/bits/atomic.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sysdeps/ia64/bits/atomic.h b/sysdeps/ia64/bits/atomic.h
index 0e9dfc7..4c2b540 100644
--- a/sysdeps/ia64/bits/atomic.h
+++ b/sysdeps/ia64/bits/atomic.h
@@ -82,9 +82,7 @@ typedef uintmax_t uatomic_max_t;
   (__sync_synchronize (), __sync_lock_test_and_set (mem, value))
 
 #define atomic_exchange_and_add(mem, value) \
-  ({ __typeof (*mem) __result;                                               \
-     __result = __sync_fetch_and_add ((mem), (int) (value));                 \
-     __result; })
+  __sync_fetch_and_add ((mem), (value))
 
 #define atomic_decrement_if_positive(mem) \
   ({ __typeof (*mem) __oldval, __val;                                        \
-- 
2.4.4





Reply via email to