mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Richard Pennington <rich@pennware.com>
To: musl@lists.openwall.com
Cc: Rich Felker <dalias@aerifal.cx>
Subject: Re: Clang powerpc pthread_arch.h patch.
Date: Mon, 02 Dec 2013 06:50:13 -0600	[thread overview]
Message-ID: <529C8205.605@pennware.com> (raw)
In-Reply-To: <20131202074806.GG24286@brightrain.aerifal.cx>

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


      reply	other threads:[~2013-12-02 12:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-24 19:23 Richard Pennington
2013-11-24 22:31 ` Rich Felker
2013-11-24 22:46   ` Richard Pennington
2013-12-02  7:48     ` Rich Felker
2013-12-02 12:50       ` Richard Pennington [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=529C8205.605@pennware.com \
    --to=rich@pennware.com \
    --cc=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).