public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH 01/18] nptl: Move pthread_mutex_consistent into libc
Date: Tue, 16 Mar 2021 06:42:30 +0100	[thread overview]
Message-ID: <87a6r3slh5.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <67d38097-51d3-e650-b327-7f9430090012@linaro.org> (Adhemerval Zanella's message of "Mon, 15 Mar 2021 16:30:57 -0300")

* Adhemerval Zanella:

>> index 937c7c4640..0a84063a2b 100644
>> --- a/nptl/pthread_mutex_consistent.c
>> +++ b/nptl/pthread_mutex_consistent.c
>> @@ -18,10 +18,10 @@
>>  
>>  #include <errno.h>
>>  #include <pthreadP.h>
>> -
>> +#include <shlib-compat.h>
>>  
>>  int
>> -pthread_mutex_consistent (pthread_mutex_t *mutex)
>> +__pthread_mutex_consistent (pthread_mutex_t *mutex)
>>  {
>>    /* Test whether this is a robust mutex with a dead owner.
>>       See concurrency notes regarding __kind in struct __pthread_mutex_s
>> @@ -35,4 +35,20 @@ pthread_mutex_consistent (pthread_mutex_t *mutex)
>>  
>>    return 0;
>>  }
>> -weak_alias (pthread_mutex_consistent, pthread_mutex_consistent_np)
>> +versioned_symbol (libc, __pthread_mutex_consistent, pthread_mutex_consistent,
>> +                  GLIBC_2_34);
>> +
>> +#if SHLIB_COMPAT (libc, GLIBC_2_4, GLIBC_2_34)
>
> Shouldn't be GLIBC_2_12 here?

Where exactly?  There are so many symbol versions.  The _np variant was
introduced in GLIBC_2.4, so GLIBC_2_4 is correct here.  It ran parallel
with the non-_np variant until GLIBC_2.34, so that's the end range.

>> +/* Compat symbol with the old libc version, _np alias.  */
>> +# undef pthread_mutex_consistent_np
>
> I think should be out of SHLIB_COMPAT.

It will go away if I switch to __REDIRECT.

>> +strong_alias (__pthread_mutex_consistent, __pthread_mutex_consistent_1)
>> +compat_symbol (libc, __pthread_mutex_consistent_1,
>> +               pthread_mutex_consistent_np, GLIBC_2_4);
>> +#endif
>> +
>> +#if SHLIB_COMPAT (libc, GLIBC_2_12, GLIBC_2_34)
>> +/* Compat symbol with the old libc version.  */
>> +strong_alias (__pthread_mutex_consistent, __pthread_mutex_consistent_2)
>> +compat_symbol (libc, __pthread_mutex_consistent_2,
>> +               pthread_mutex_consistent, GLIBC_2_12);
>> +#endif
>
> I think we have compat_symbol_unique exactly for that.

It doesn't apply here because the symbol names are different
(__pthread_mutex_consistent vs pthread_mutex_consistent):

# define compat_symbol_unique(lib, name, version) \

The macro has just one name argument.

>> diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
>> index a04a3a2754..2ec2caec98 100644
>> --- a/sysdeps/nptl/pthread.h
>> +++ b/sysdeps/nptl/pthread.h
>> @@ -809,8 +809,9 @@ extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
>>  extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
>>       __THROW __nonnull ((1));
>>  # ifdef __USE_GNU
>> -extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
>> -     __THROW __nonnull ((1));
>> +#  define pthread_mutex_consistent_np __glibc_macro_warning ("\
>> +pthread_mutex_consistent_np is deprecated, use pthread_mutex_consistent") \
>> +  pthread_mutex_consistent
>>  # endif
>>  #endif
>>  
>
> Wouldn't be better to throw a link error instead an empty macro for such
> case?

It's not an empty macro, there's a third line.  I can see if I can use
__REDIRECT instead if that's clearer.

Thanks,
Florian


  reply	other threads:[~2021-03-16  5:42 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 17:48 [PATCH 00/18] Repost of pending libpthread removal patches Florian Weimer
2021-03-12 17:48 ` [PATCH 01/18] nptl: Move pthread_mutex_consistent into libc Florian Weimer
2021-03-15 19:30   ` Adhemerval Zanella
2021-03-16  5:42     ` Florian Weimer [this message]
2021-03-16 13:49       ` Adhemerval Zanella
2021-03-16 13:53         ` Florian Weimer
2021-03-16 14:07           ` Adhemerval Zanella
2021-03-12 17:49 ` [PATCH 02/18] nptl: Move __pthread_cleanup_routine " Florian Weimer
2021-03-15 19:53   ` Adhemerval Zanella
2021-03-16  7:09     ` Florian Weimer
2021-03-12 17:49 ` [PATCH 03/18] nptl: Move legacy unwinding implementation " Florian Weimer
2021-03-15 20:02   ` Adhemerval Zanella
2021-03-16  7:03     ` Florian Weimer
2021-03-12 17:49 ` [PATCH 04/18] nptl: Move legacy cancelation handling into libc as compat symbols Florian Weimer
2021-03-16 14:09   ` Adhemerval Zanella
2021-03-16 14:45     ` Florian Weimer
2021-03-16 18:14       ` Adhemerval Zanella
2021-03-12 17:49 ` [PATCH 05/18] nptl: Remove longjmp, siglongjmp from libpthread Florian Weimer
2021-03-16 14:13   ` Adhemerval Zanella
2021-03-16 14:39     ` Florian Weimer
2021-03-12 17:49 ` [PATCH 06/18] Legacy unwinder: Remove definition of _Unwind_GetCFA Florian Weimer
2021-03-16 14:14   ` Adhemerval Zanella
2021-03-12 17:49 ` [PATCH 07/18] nptl: Move __pthread_cleanup_upto into libc Florian Weimer
2021-03-16 14:35   ` Adhemerval Zanella
2021-03-12 17:49 ` [PATCH 08/18] nptl: Move pthread_once and __pthread_once " Florian Weimer
2021-03-15 19:24   ` Florian Weimer
2021-03-12 17:49 ` [PATCH 09/18] nptl: Move __pthread_unwind_next " Florian Weimer
2021-03-12 17:49 ` [PATCH 10/18] csu: Move calling main out of __libc_start_main_impl Florian Weimer
2021-03-12 17:49 ` [PATCH 11/18] nptl: Move internal __nptl_nthreads variable into libc Florian Weimer
2021-03-12 17:49 ` [PATCH 12/18] nptl_db: Introduce DB_MAIN_ARRAY_VARIABLE Florian Weimer
2021-03-12 17:50 ` [PATCH 13/18] nptl: Move __pthread_keys global variable into libc Florian Weimer
2021-03-12 17:50 ` [PATCH 14/18] nptl: Move __nptl_deallocate_tsd " Florian Weimer
2021-03-12 17:50 ` [PATCH 15/18] nptl: Move pthread_exit " Florian Weimer
2021-03-12 17:50 ` [PATCH 16/18] nptl: Move pthread_setcancelstate " Florian Weimer
2021-03-12 17:50 ` [PATCH 17/18] nptl: Move pthread_setcanceltype " Florian Weimer
2021-03-12 17:50 ` [PATCH 18/18] nptl: Invoke the set_robust_list system call directly in fork Florian Weimer

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=87a6r3slh5.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /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).