From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4324 Path: news.gmane.org!not-for-mail From: Richard Pennington Newsgroups: gmane.linux.lib.musl.general Subject: Re: Clang powerpc pthread_arch.h patch. Date: Mon, 02 Dec 2013 06:50:13 -0600 Message-ID: <529C8205.605@pennware.com> References: <52925240.7050300@pennware.com> <20131124223148.GC24286@brightrain.aerifal.cx> <529281D8.9020909@pennware.com> <20131202074806.GG24286@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1385989073 603 80.91.229.3 (2 Dec 2013 12:57:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Dec 2013 12:57:53 +0000 (UTC) Cc: Rich Felker To: musl@lists.openwall.com Original-X-From: musl-return-4328-gllmg-musl=m.gmane.org@lists.openwall.com Mon Dec 02 13:57:59 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1VnT4X-00045y-Kf for gllmg-musl@plane.gmane.org; Mon, 02 Dec 2013 13:57:57 +0100 Original-Received: (qmail 20235 invoked by uid 550); 2 Dec 2013 12:57:53 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 20224 invoked from network); 2 Dec 2013 12:57:53 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 In-Reply-To: <20131202074806.GG24286@brightrain.aerifal.cx> X-RR-Connecting-IP: 107.14.168.142:25 X-Cloudmark-Score: 0 Xref: news.gmane.org gmane.linux.lib.musl.general:4324 Archived-At: On 12/02/2013 01:48 AM, Rich Felker wrote: > On Sun, Nov 24, 2013 at 04:46:48PM -0600, Richard Pennington wrote: >> On 11/24/2013 04:31 PM, Rich Felker wrote: >>> On Sun, Nov 24, 2013 at 01:23:44PM -0600, Richard Pennington wrote: >>>> I had a problem with clang and __pthread_self() on the powerpc. This >>>> is the patch I applied to work around it. >>>> >>>> Index: pthread_arch.h >>>> =================================================================== >>>> --- pthread_arch.h (revision 3604) >>>> +++ pthread_arch.h (working copy) >>>> @@ -1,6 +1,11 @@ >>>> static inline struct pthread *__pthread_self() >>>> { >>>> +#ifdef __clang__ >>>> + char *tp; >>>> + __asm__ __volatile__ ("mr %0, 2" : "=r" (tp) : : "2" ); >>>> +#else >>> Why is "2" in the clobberlist? It's just read, not written. In >>> principle there should be some way to indicate that the asm has hidden >>> state it reads so that it couldn't be reordered before the initial asm >>> call that initializes the register, but that would be massive >>> reordering that's not likely to happen anyway. I'm not sure what the >>> right way to encode this as a constraint is... >>> >>> Rich >> Hi Rich, >> >> You're right about the clobber list. Not that it matters much in >> this case I think. > Committed a fix based on your patch; let me know if you still have > problems with it. > > Rich > > Thanks Rich. It has been working fine here. -Rich