From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4279 Path: news.gmane.org!not-for-mail From: Richard Pennington Newsgroups: gmane.linux.lib.musl.general Subject: Clang powerpc pthread_arch.h patch. Date: Sun, 24 Nov 2013 13:23:44 -0600 Message-ID: <52925240.7050300@pennware.com> 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 1385321473 2914 80.91.229.3 (24 Nov 2013 19:31:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Nov 2013 19:31:13 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4283-gllmg-musl=m.gmane.org@lists.openwall.com Sun Nov 24 20:31:19 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 1VkfOm-00028K-0C for gllmg-musl@plane.gmane.org; Sun, 24 Nov 2013 20:31:16 +0100 Original-Received: (qmail 16251 invoked by uid 550); 24 Nov 2013 19:31:15 -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 16240 invoked from network); 24 Nov 2013 19:31:14 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 X-RR-Connecting-IP: 107.14.168.142:25 X-Cloudmark-Score: 0 Xref: news.gmane.org gmane.linux.lib.musl.general:4279 Archived-At: 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 register char* tp __asm__("r2"); +#endif return (pthread_t)(tp - 0x7000 - sizeof(struct pthread)); } -Rich