From patchwork Tue Mar 25 16:22:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 275 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (caibbdcaabij.dreamhost.com [208.113.200.189]) by wilcox.dreamhost.com (Postfix) with ESMTP id 48B3C3600A2 for ; Tue, 25 Mar 2014 09:21:43 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14307373) id EB28A431861B; Tue, 25 Mar 2014 09:21:42 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx22.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx22.g.dreamhost.com (Postfix) with ESMTPS id C2859431862A for ; Tue, 25 Mar 2014 09:21:42 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; q=dns; s=default; b=EwDK 3GrIlWg48vZk/yBvoZWIothb1yLoSAtZ4vlS114S7mE+9/eKE0hpb7+TObeaZ8kf fWPT8u42cM9dMCuwwcXKVn2Zelh1KwPwbzyomqFWpcGbuKvAp0Y6TIR0sBKvRWdJ P35XXuizXPk62UDDqSVpOOjlbdd0634p3iWt4KQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; s=default; bh=OoXHqXvxrt vaNul7TDKKO4Jg/+g=; b=tFzki20Zpu3ix6w/RYoqyfUXaXAHMaVytJdh6SIZQO mhO+go+7mZ9UgmFoWlKICL0/DurmvxGeaSDf6KVwuukp1ByURky5l0dFmazOTNLW OJixxaLM+D/CnDvWk268SxMtRVUci+1f9xzBs851AF9RB15ZbtJawCECJv0UGEid E= Received: (qmail 16654 invoked by alias); 25 Mar 2014 16:21:39 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 16591 invoked by uid 89); 25 Mar 2014 16:21:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Date: Tue, 25 Mar 2014 21:52:04 +0530 From: Siddhesh Poyarekar To: Adhemerval Zanella Cc: Andreas Schwab , libc-alpha@sourceware.org Subject: Re: [PATCH] PowerPC: Define __PTHREAD_MUTEX_HAVE_ELISION to 0 Message-ID: <20140325162204.GH1850@spoyarek.pnq.redhat.com> References: <532C872D.8030107@linux.vnet.ibm.com> <53318BC9.40404@linux.vnet.ibm.com> <5331A8BF.3050401@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5331A8BF.3050401@linux.vnet.ibm.com> User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) X-DH-Original-To: glibc@patchwork.siddhesh.in On Tue, Mar 25, 2014 at 01:03:11PM -0300, Adhemerval Zanella wrote: > I agree with you, but the patch to check if it is defined in nptl/sysdeps/pthread/pthread.h > was rejected: https://sourceware.org/ml/libc-alpha/2014-03/msg00494.html. So I just folowed > the way x86_64 and s390 does. If this was just an warning I'd rework it to make it more general, > as Roland as suggested in https://sourceware.org/ml/libc-alpha/2014-03/msg00501.html; but it is > breaking 'make check' build. So my preference now is let it as and focus on a proper fix, if > any, after. Perhaps it would be acceptable to define __PTHREAD_MUTEX_HAVE_ELISION unconditionally in pthread.h and then redefine it in x86_64 and s390 like so: Both approaches ensure that the macro is always defined and hence look typo-proof to me. Siddhesh diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h index 1e0c5dc..524b8c4 100644 --- a/nptl/sysdeps/pthread/pthread.h +++ b/nptl/sysdeps/pthread/pthread.h @@ -23,6 +23,8 @@ #include #include +#define __PTHREAD_MUTEX_HAVE_ELISION 0 + #include #include #include diff --git a/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h index 28e5144..8548d9d 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h @@ -84,6 +84,7 @@ typedef struct __pthread_internal_slist } __pthread_slist_t; #endif +#undef __PTHREAD_MUTEX_HAVE_ELISION /* Data structures for mutex handling. The structure of the attribute type is not exposed on purpose. */ or alternatively, define __PTHREAD_MUTEX_HAVE_ELISION to 0 if it is not yet defined, which is a variant of Will's original fix: diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h index 1e0c5dc..deeea0d 100644 --- a/nptl/sysdeps/pthread/pthread.h +++ b/nptl/sysdeps/pthread/pthread.h @@ -27,6 +27,9 @@ #include #include +#ifndef __PTHREAD_MUTEX_HAVE_ELISION +# define __PTHREAD_MUTEX_HAVE_ELISION 0 +#endif /* Detach state. */ enum