From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by sourceware.org (Postfix) with ESMTPS id 0B1F33857C7F for ; Fri, 19 Mar 2021 12:34:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0B1F33857C7F Received: by mail-qv1-xf31.google.com with SMTP id t5so4886036qvs.5 for ; Fri, 19 Mar 2021 05:34:34 -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=HSTA5LEoIpzPyVBw5vqBmoQwIldqqOeQqTTpNSdCDOg=; b=Z4+daxHH0S3x+ORuy/Pv6r1UTGvtv40g9mQkRApgxtN+1chf78Bzlq+zIkf+pisD+o AK13TTT+zj+sc9kKDkPmduJLVohJuHCByFZaw2jNiEiJiPoz4J3FhmgSYkNxx6G6g6bb 4inCJu0e4x9JdLnJUCaNq7cY3UrOUuNsbEzKYC5XFVoldVZHg8G9Pt7MmobyMO44X455 qNguHdQFMQ/BC72zD7291RXLmZViw5/GMvxczTl30raTattskGnwQHgoHefFgSGdzSmo CjCyQWZVqG6alURkYCOgG32xDY9AiRi3NILBgZ9q3gX6VMJuZbeBaoC+5r3lyARvas5+ EEgw== X-Gm-Message-State: AOAM533JyNy93J6Tf6z/+nv7C0iclYIURP1PkT+rR5/H/rCWQxVeYqPf +HiOEh9OB6VxLk16ri8XlSYkcV3rdHrAouAl X-Google-Smtp-Source: ABdhPJxd/9rtTD+Y/WNb321wr1YL2jto+IVV/iec2GXTGyIXSjXsy7IIbP4PdIMHCG6/CTzD3xwFiQ== X-Received: by 2002:a0c:c488:: with SMTP id u8mr8778312qvi.47.1616157273412; Fri, 19 Mar 2021 05:34:33 -0700 (PDT) Received: from [192.168.1.4] ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm4279740qkl.21.2021.03.19.05.34.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Mar 2021 05:34:33 -0700 (PDT) Subject: Re: [PATCH 15/30] nptl: Remove pread from libpthread To: Florian Weimer , Joseph Myers Cc: Adhemerval Zanella via Libc-alpha References: <20210316200510.2135405-1-adhemerval.zanella@linaro.org> <20210316200510.2135405-16-adhemerval.zanella@linaro.org> <87o8fhy3r8.fsf@oldenburg.str.redhat.com> <87k0q5y3cx.fsf@oldenburg.str.redhat.com> <986f7915-13ad-97d8-230d-797000c6c397@linaro.org> <87wnu5wnrg.fsf@oldenburg.str.redhat.com> <87pmzwu62i.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Message-ID: <54668575-23ca-22a8-4148-357c7e3f187a@linaro.org> Date: Fri, 19 Mar 2021 09:34:29 -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: <87pmzwu62i.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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: Fri, 19 Mar 2021 12:34:35 -0000 On 18/03/2021 07:09, Florian Weimer wrote: > * Joseph Myers: > >> On Wed, 17 Mar 2021, Florian Weimer via Libc-alpha wrote: >> >>> Ah I see it now: mips64-linux-gnu-n64 has only this: >>> >>> 1556: 0000000000109b70 300 FUNC GLOBAL DEFAULT 12 __libc_pread@@GLIBC_PRIVATE >>> 2229: 0000000000109b70 300 FUNC WEAK DEFAULT 12 pread@@GLIBC_2.2 >> >> (Because MIPS didn't have glibc 2.1, so uses the shlib-versions feature of >> skipping all versions between GLIBC_2.0 and GLIBC_2.2 and mapping them to >> GLIBC_2.2.) >> >>> Likewise ia64-linux-gnu: >>> >>> 1640: 00000000001bb180 528 FUNC GLOBAL DEFAULT 11 __libc_pread@@GLIBC_PRIVATE >>> 2624: 00000000001bb180 528 FUNC WEAK DEFAULT 11 pread@@GLIBC_2.2 >> >> (Because ia64 symbol versions for many libraries start at GLIBC_2.2.) > > Ahh, so alpha isn't really an outlier after all? > > Adhemerval, would you please check if you can write a condition in > generic code using OTHERLIB_COMPAT (libpthread, …) with the appropriate > version ranges? > > OTHERLIB_COMPAT would have to be defined like this: > > diff --git a/include/shlib-compat.h b/include/shlib-compat.h > index 4b224c2672..6303639f28 100644 > --- a/include/shlib-compat.h > +++ b/include/shlib-compat.h > @@ -45,6 +45,14 @@ > > #ifdef SHARED > > +/* Like LIB_COMPAT, but can check versions in other libraries. It is > + not always false outside for !IS_IN (LIB). */ > +#define OTHERLIB_COMPAT(lib, introduced, obsoleted) \ > + _LIB_COMPAT (lib, introduced, obsoleted) I think you meant _OTHERLIB_COMPAT here. > +#define _OTHERLIB_COMPAT(lib, introduced, obsoleted) \ > + (!(ABI_##lib##_##obsoleted - 0) \ > + || ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0))) > + > /* Similar to LIB_COMPAT, but evaluate to 0 for static build. The > compatibility code should be conditionalized with e.g. > `#if SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_2)' for code introduced > @@ -79,6 +87,7 @@ > #else > > /* Not compiling ELF shared libraries at all, so never any old versions. */ > +# define OTHERLIB_COMPAT(lib, introduced, obsoleted) 0 > # define SHLIB_COMPAT(lib, introduced, obsoleted) 0 > > /* No versions to worry about, just make this the global definition. */ I tried, but the issue is although it fixes alpha it throws an error for i386 with 'multiple definition of `pread@GLIBC_2.2' since its ABI also exports the same symbol version *but* in a different TU (non-LFS Linux pread.c). The issue alpha is currently the *only* ABI with has a versioned pread@GLIBC_2.2, but it is also a LFS as default so the its versioned pread@GLIBC_2.2 is an alias for __libc_pread64. I think it would be simpler to just move this logic to an alpha specific implementation, LFS is making this way more complex than it should be.