From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by sourceware.org (Postfix) with ESMTPS id F24E33861012 for ; Tue, 16 Mar 2021 14:07:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F24E33861012 Received: by mail-qv1-xf36.google.com with SMTP id t5so9538418qvs.5 for ; Tue, 16 Mar 2021 07:07:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=QvvnRFdmuvNeRb4nY5afQOOUnLeD3m4JMI0tZE8StLM=; b=WVBEF6q2XkrVZBhxGTDZAGgwO18tulBOE4aszY1VMQxLug+a3bhcDyuF+jomGwT6ab NE/jk9rSaXeHWRqMh1IL2Ja9azMUcqlv90WmNMZnKSU9UH1SGfytdGlWoDd5TZm77ryK RsqpniZ2N1GyKV4Vo5KCRTFoezil0bnx5hnwuuhowkHrFzL9OXeWAEEj2n364Anq/YJA AgKGigbqDK182VdmbEWMEA+BxRXnXj5Cu84cuDN73p9UHD6LB73cYNmNyh7UWkCOAwDO j5BIzxqnjbar8LarR4+xCM3Yg2ptUwInR/ieVxzCf2LFz9R4cn/Hvl6cw8VG2n/iJTfT i5Zg== X-Gm-Message-State: AOAM530BkUwxQt1i+m4qCALNZsBAS1KSSumWoOFN2pPqBTzSZPFLxHVK izzOlp7SOWZH/kod0AzxrV2J/owUfwpq5bxj X-Google-Smtp-Source: ABdhPJxOmey4h2BRy1PXMRKLOxcHDOjKE9e0ghAIkR943JIvEvSVaeOj4nbBk9xE1MNCaPzfdoBMng== X-Received: by 2002:ad4:4904:: with SMTP id bh4mr29280859qvb.53.1615903650311; Tue, 16 Mar 2021 07:07:30 -0700 (PDT) Received: from [192.168.1.4] ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id 73sm14910750qkk.131.2021.03.16.07.07.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Mar 2021 07:07:30 -0700 (PDT) Subject: Re: [PATCH 01/18] nptl: Move pthread_mutex_consistent into libc To: Florian Weimer Cc: libc-alpha@sourceware.org References: <22de850756d320f188c0ccd53e298b13768e0c49.1615569355.git.fweimer@redhat.com> <67d38097-51d3-e650-b327-7f9430090012@linaro.org> <87a6r3slh5.fsf@oldenburg.str.redhat.com> <34cb8f68-d763-89c0-b93f-3495774c616d@linaro.org> <875z1rp5m3.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Message-ID: <9858a761-8ca5-8de2-5ade-4be31fa3d9d0@linaro.org> Date: Tue, 16 Mar 2021 11:07:27 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <875z1rp5m3.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Mar 2021 14:07:32 -0000 On 16/03/2021 10:53, Florian Weimer wrote: > * Adhemerval Zanella: > >> On 16/03/2021 02:42, Florian Weimer wrote: >>> * Adhemerval Zanella: >>> >>>>> index 937c7c4640..0a84063a2b 100644 >>>>> --- a/nptl/pthread_mutex_consistent.c >>>>> +++ b/nptl/pthread_mutex_consistent.c >>>>> @@ -18,10 +18,10 @@ >>>>> >>>>> #include >>>>> #include >>>>> - >>>>> +#include >>>>> >>>>> 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. >> >> I meant 'SHLIB_COMPAT (libc, GLIBC_2_4, GLIBC_2_12)' > > This would be wrong because until glibc 2.33, both symbols existed in > parallel AFAICS. > Yeah, you are right. >>>> 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. >> >> Indeed, I will add a macro similar to compat_symbol_unique, but >> that redirects to a an alias instead. > > We could teach compat_symbol to always create an alias first. > >> Ah right, I didn't noticed the last 'pthread_mutex_consistent'. >> >> Patch look ok then, I think if you could remove the extra >> pthread_mutex_consistent define on the installed header would be better >> but it not a blocker. > > I'm going to repost it as part of the ongoing series. I could get > __REDIRECT to work. > > Thanks, > Florian > Ok.