public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: libc-alpha@sourceware.org,  Szabolcs Nagy <szabolcs.nagy@arm.com>
Subject: Re: [PATCH] nptl: Add missing __pthread_cond_wait alias in static builds
Date: Wed, 19 May 2021 22:20:06 +0200	[thread overview]
Message-ID: <87v97etr0p.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <YKVwfifG1W95HMtr@google.com> (Jonathan Nieder's message of "Wed,  19 May 2021 13:09:34 -0700")

* Jonathan Nieder:

> Hi,
>
> Florian Weimer wrote:
>
>> Fixes commit cf3fff1c195f859ba949a7ad86d4fca70bd99740 ("nptl: Move
>> cnd_wait into libc").
>>
>> I think this is the only missing strong_alias.  The other places either
>> have a matching versioned_symbol for the __pthread_ internal alias,
>> already define the strong alias, or there are no internal callers.
>>
>> Tested on i686-linux-gnu and x86_64-linux-gnu.  Built with
>> build-many-glibcs.py.
>>
>> Thanks,
>> Florian
>> ---
>>  nptl/pthread_cond_wait.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
>> index 54e504a6b5..409a99ecb7 100644
>> --- a/nptl/pthread_cond_wait.c
>> +++ b/nptl/pthread_cond_wait.c
>> @@ -622,6 +622,9 @@ ___pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex)
>>  versioned_symbol (libc, ___pthread_cond_wait, pthread_cond_wait,
>>  		  GLIBC_2_3_2);
>>  libc_hidden_ver (___pthread_cond_wait, __pthread_cond_wait)
>> +#ifndef SHARED
>> +strong_alias (___pthread_cond_wait, __pthread_cond_wait)
>> +#endif
>
> It took me a while to catch what is going on here: the left-hand side
> has *three* underscores, while the right-hand side has the usual two.
> I think the three underscores means it's not meant to be exported, but
> I'm not sure; is there some documentation that covers the conventions
> in this area?
>
> In any event, this matches the code in similar cases, so in addition
> to getting the job done it's improving consistency. :)  So,
>
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Thanks.

Unfortunately, there is no consistent convention.  We recently gained
the ability to set multiple symbol versions on the same symbol, and
before that, …_1 and …_2 aliases were sometimes used.  I hope get rid of
the macro bits eventually and switch to something more palatable, but I
don't know what that would like.  Maybe we should rewrite the object
files with the symbol data we want, I'm not sure.  Or generate source
code snippets that can be #include'd at the end of source files that
define a public function.

Florian


      reply	other threads:[~2021-05-19 20:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 19:10 Florian Weimer
2021-05-19 20:09 ` Jonathan Nieder
2021-05-19 20:20   ` Florian Weimer [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=87v97etr0p.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=jrnieder@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=szabolcs.nagy@arm.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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).