libgfortran: Avoid using libquadmath APIs on powerpc64le on glibc 2.32+
authorJakub Jelinek <jakub@redhat.com>
Fri, 7 Jan 2022 17:42:46 +0000 (18:42 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 11 Jan 2022 22:49:52 +0000 (23:49 +0100)
commit4d0e778fe3d064e3896b7f5f7de78a479f27dc55
tree3de26d1dbab68a54880a376d6b2711a0465637f2
parent7d8011fa00fca283003c84e23a8ca66286f83dfa
libgfortran: Avoid using libquadmath APIs on powerpc64le on glibc 2.32+

On a glibc 2.32+ build, we still use some libquadmath APIs
when we shouldn't:
readelf -Wr /home/jakub/gcc/obj/powerpc64le-unknown-linux-gnu/libgfortran/.libs/libgfortran.so.5 | grep QUADMATH
00000000002502c8  0000002600000015 R_PPC64_JMP_SLOT       0000000000000000 fmaq@QUADMATH_1.0 + 0
00000000002505f8  0000006700000015 R_PPC64_JMP_SLOT       0000000000000000 tanq@QUADMATH_1.0 + 0
0000000000250930  0000009b00000015 R_PPC64_JMP_SLOT       0000000000000000 fabsq@QUADMATH_1.0 + 0
0000000000250940  0000009d00000015 R_PPC64_JMP_SLOT       0000000000000000 sinq@QUADMATH_1.0 + 0
0000000000250c98  000000cf00000015 R_PPC64_JMP_SLOT       0000000000000000 copysignq@QUADMATH_1.0 + 0
0000000000251038  0000010700000015 R_PPC64_JMP_SLOT       0000000000000000 cosq@QUADMATH_1.0 + 0
0000000000251068  0000010a00000015 R_PPC64_JMP_SLOT       0000000000000000 fmodq@QUADMATH_1.0 + 0
These should use __fmaieee128, __tanieee128 etc. instead.

2022-01-07  Jakub Jelinek  <jakub@redhat.com>

* libgfortran.h (__copysignieee128, __fmaieee128, __fmodieee128):
Declare.
* intrinsics/trigd.c (COPYSIGN, FMOD, FABS, FMA, SIN, COS, TAN): If
POWER_IEEE128 is defined, define these for kind 17 include.
* intrinsics/trigd_lib.inc (COPYSIGN, FMOD, FABS, FMA, SIN, COS, TAN):
Don't define if COPYSIGN is already defined.
libgfortran/intrinsics/trigd.c
libgfortran/intrinsics/trigd_lib.inc
libgfortran/libgfortran.h