From 4ef95943288e1b0ee4939527f952c98c4a0cddc1 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Tue, 1 Oct 2013 20:23:50 +0530 Subject: [PATCH] Fix PI mutex check for non-x86 and resync with upstream master --- glibc-rh1007590.patch | 46 +++++++++++++++++++++++++++++++++++++++++++ glibc.spec | 11 +++++++++-- sources | 2 +- 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 glibc-rh1007590.patch diff --git a/glibc-rh1007590.patch b/glibc-rh1007590.patch new file mode 100644 index 0000000..0637740 --- /dev/null +++ b/glibc-rh1007590.patch @@ -0,0 +1,46 @@ +commit ab8473b63982c814cdf509b8061fe0152cf3fd39 +Author: Siddhesh Poyarekar +Date: Tue Oct 1 14:29:00 2013 +0530 + + Fix PI mutex check in pthread_cond_broadcast and pthread_cond_signal + + The check had a typo - it checked for PTHREAD_MUTEX_ROBUST instead of + PTHREAD_MUTEX_NORMAL_ROBUST_NP. It has now been replaced by the + already existing convenience macro USE_REQUEUE_PI. + +diff --git a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c +index 0702ec0..7ba9efa 100644 +--- a/nptl/pthread_cond_broadcast.c ++++ b/nptl/pthread_cond_broadcast.c +@@ -63,10 +63,7 @@ __pthread_cond_broadcast (cond) + + #if (defined lll_futex_cmp_requeue_pi \ + && defined __ASSUME_REQUEUE_PI) +- int pi_flag = PTHREAD_MUTEX_PRIO_INHERIT_NP | PTHREAD_MUTEX_ROBUST_NP; +- pi_flag &= mut->__data.__kind; +- +- if (pi_flag == PTHREAD_MUTEX_PRIO_INHERIT_NP) ++ if (USE_REQUEUE_PI (mut)) + { + if (lll_futex_cmp_requeue_pi (&cond->__data.__futex, 1, INT_MAX, + &mut->__data.__lock, futex_val, +diff --git a/nptl/pthread_cond_signal.c b/nptl/pthread_cond_signal.c +index 102d0b3..ffc35dc 100644 +--- a/nptl/pthread_cond_signal.c ++++ b/nptl/pthread_cond_signal.c +@@ -49,14 +49,9 @@ __pthread_cond_signal (cond) + + #if (defined lll_futex_cmp_requeue_pi \ + && defined __ASSUME_REQUEUE_PI) +- int pi_flag = PTHREAD_MUTEX_PRIO_INHERIT_NP | PTHREAD_MUTEX_ROBUST_NP; + pthread_mutex_t *mut = cond->__data.__mutex; + +- /* Do not use requeue for pshared condvars. */ +- if (mut != (void *) ~0l) +- pi_flag &= mut->__data.__kind; +- +- if (__builtin_expect (pi_flag == PTHREAD_MUTEX_PRIO_INHERIT_NP, 0) ++ if (USE_REQUEUE_PI (mut) + /* This can only really fail with a ENOSYS, since nobody can modify + futex while we have the cond_lock. */ + && lll_futex_cmp_requeue_pi (&cond->__data.__futex, 1, 0, diff --git a/glibc.spec b/glibc.spec index e591cd6..f1e1a2b 100644 --- a/glibc.spec +++ b/glibc.spec @@ -1,6 +1,6 @@ -%define glibcsrcdir glibc-2.18-151-g303e567 +%define glibcsrcdir glibc-2.18-186-gfd96752 %define glibcversion 2.18.90 -%define glibcrelease 6%{?dist} +%define glibcrelease 7%{?dist} # Pre-release tarballs are pulled in from git using a command that is # effectively: # @@ -211,6 +211,8 @@ Patch2026: %{name}-rh841787.patch # Upstream BZ 14185 Patch2027: %{name}-rh819430.patch +Patch2028: %{name}-rh1007590.patch + ############################################################################## # End of glibc patches. ############################################################################## @@ -536,6 +538,7 @@ package or when debugging this package. %patch0041 -p1 %patch0042 -p1 %patch0043 -p1 +%patch2028 -p1 ############################################################################## # %%prep - Additional prep required... @@ -1621,6 +1624,10 @@ rm -f *.filelist* %endif %changelog +* Tue Oct 1 2013 Siddhesh Poyarekar - 2.18.90-7 +- Fix check for PI mutex on non-x86 systems (#1007590). +- Resync with upstream master. + * Tue Sep 24 2013 Carlos O'Donell - 2.18.90-6 - Avoid the use of __block which is a reserved keyword for clang++ (#1009623). diff --git a/sources b/sources index 50cdc0d..b85122a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f516344ccf8bcc3a4066731ec3e62220 glibc-2.18-151-g303e567.tar.gz +c667b38ec4bf60aff4a83d756e14e7aa glibc-2.18-186-gfd96752.tar.gz