From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by sourceware.org (Postfix) with ESMTPS id 2E3D43854165; Fri, 24 Jun 2022 21:06:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2E3D43854165 X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.29] ([79.251.14.24]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M4s51-1o3Snr1h9r-0022j7; Fri, 24 Jun 2022 23:06:52 +0200 Message-ID: Date: Fri, 24 Jun 2022 23:06:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] fortran, libgfortran, v2: Avoid using libquadmath for glibc 2.26+ Content-Language: en-US To: Jakub Jelinek , gcc-patches@gcc.gnu.org, "Joseph S. Myers" , fortran@gcc.gnu.org Newsgroups: gmane.comp.gcc.patches,gmane.comp.gcc.fortran References: From: Harald Anlauf In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ahe8SsklfreKO7PqwDCDw8nA49IhOh7jSKGGN/i4Z75BiTpLM5Y J+dmShVG8++SwGbVfAvx6bdpS2YOwEcaM821DZaqeHeaQhDNQmjeS/OMuMogBSj2TsXjEzc QjiAjn7h5NT8b5QVXFHVAmbv/lP9I7jB9IxHpZc7iVTdL36nhfE7L4QtqoCqXdsdS4rnIhh IHwycRRZMOakA1WDy3ACQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:6NGYdI9raUI=:O+VL2ta3xo3n3xlbsArZXl ebRU4u83Ggk47osHQYX4bv+O7SylfaDQsaQS15DMW6VMRBUSqhXQjNJOdbTLLeLzkV2J63TU3 CV90qXn6Xm+miSg/2JUUvY8mu4UE4fcKvhPB+EOG6N+Bnslx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ED, DKIM_VALID, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2022 21:07:02 -0000 Hi Jakub, Am 24.06.22 um 12:29 schrieb Jakub Jelinek via Gcc-patches: > On Thu, Jun 23, 2022 at 11:17:50PM +0200, Jakub Jelinek via Gcc-patches = wrote: >> We currently use >> %rename lib liborig >> *lib: %{static-libgfortran:--as-needed} -lquadmath %{static-libgfortran= :--no-as-needed} -lm %(libgcc) %(liborig) >> in libgfortran.spec (on targets where we do configure in libquadmath). >> So, I believe the patch as is is an ABI change for *.o files if they us= e >> real(kind=3D16) math functions (one needs to recompile them), but not >> for linked shared libraries or executables, because the above aranges >> for them to be linked with -lquadmath or for -static-libgfortran with >> --as-needed -lquadmath --no-as-needed. The former adds libquadmath.so.= 0 >> automatically to anything gfortran links, the latter to anything that >> actually needs it (i.e. has undefined math/complex *q symbols). >> >> Note, libgfortran.so.5 itself is ABI compatible, just no longer has >> DT_NEEDED libquadmath.so.0 and uses the *f128 APIs + str{to,from}f128 >> instead of *q APIs + strtoflt128 and quadmath_snprintf. >> >> Now, what we could do if we'd want to also preserve *.o file compatibil= ity, >> would be for gcc configured on glibc 2.26+ change libgfortran.spec to >> *lib: --as-needed -lquadmath --no-as-needed -lm %(libgcc) %(liborig) >> so that we even without -static-libgfortran link in libquadmath.so.0 >> only if it is needed. So, if there will be any gcc <=3D 12 compiled >> *.o files or *.o files compiled by gcc 13 if it was configured against >> glibc 2.25 or older, we'd link -lquadmath in, but if there are just >> *.o files referencing *f128 symbols, we wouldn't. >> >>> Am I right in assuming that this also effectively fixes PR46539? >>> (Add -static-libquadmath). >> >> That was one of the intents of the patch. >> But sure, it doesn't introduce -static-libquadmath, nor arranges for >> -static-libgfortran to link libquadmath statically, just in some cases >> (gcc configured on glibc 2.26 or later) and when everything that calls >> real(kind=3D16) math functions has been recompiled arranges for libquad= math >> not to be used at all. > > Here is an updated patch that does that. very good! >>>> --- gcc/fortran/trans-intrinsic.cc.jj 2022-05-16 11:14:57.587427707 += 0200 >>>> +++ gcc/fortran/trans-intrinsic.cc 2022-06-23 11:42:03.355899271 +020= 0 >>>> @@ -155,7 +155,7 @@ builtin_decl_for_precision (enum built_i >>>> else if (precision =3D=3D TYPE_PRECISION (double_type_node)) >>>> i =3D m->double_built_in; >>>> else if (precision =3D=3D TYPE_PRECISION (long_double_type_node) >>>> - && (!gfc_real16_is_float128 >>>> + && ((!gfc_real16_is_float128 & !gfc_real16_is__Float128) >>> >>> Shouldn't this be && instead of & ? >> >> You're right, will fix. > > And this too. > > So I believe it should now be fully ABI compatible. Great, thanks! Harald