Message ID | yddfvq7c7f2.fsf@CeBiTec.Uni-Bielefeld.DE |
---|---|
State | New |
Headers | show |
Rainer Orth wrote: > Unfortunately, this breaks Solaris/SPARC bootstrap: > > /vol/gcc/src/hg/trunk/local/libgfortran/intrinsics/erfc_scaled.c:64:22: error: 'M_2_SQRTPIl' undeclared (first use in this function) > # define _M_2_SQRTPI M_2_SQRTPIl > > It seems M_2_SQRTPI[lq] are GNU extensions, thus missing in Solaris > <math.h>. The following patch at least allows Solaris bootstrap to > continue: The patch is looks good to me. > diff --git a/libgfortran/intrinsics/erfc_scaled.c b/libgfortran/intrinsics/erfc_scaled.c > +# ifndef M_2_SQRTPIl > +# define M_2_SQRTPIl 1.128379167095512573896158903121545172L > +# endif > > I suppose the same should be done for M_2_SQRTPIq? I don't think so. That's defined in libquadmath's quadmath.h, which is part of GCC. Tobias
Tobias Burnus <burnus@net-b.de> writes: > Rainer Orth wrote: >> Unfortunately, this breaks Solaris/SPARC bootstrap: >> >> /vol/gcc/src/hg/trunk/local/libgfortran/intrinsics/erfc_scaled.c:64:22: error: 'M_2_SQRTPIl' undeclared (first use in this function) >> # define _M_2_SQRTPI M_2_SQRTPIl >> >> It seems M_2_SQRTPI[lq] are GNU extensions, thus missing in Solaris >> <math.h>. The following patch at least allows Solaris bootstrap to >> continue: > > The patch is looks good to me. Thanks. I'll commit it with a proper ChangeLog entry after testing completes. >> diff --git a/libgfortran/intrinsics/erfc_scaled.c b/libgfortran/intrinsics/erfc_scaled.c >> +# ifndef M_2_SQRTPIl >> +# define M_2_SQRTPIl 1.128379167095512573896158903121545172L >> +# endif >> >> I suppose the same should be done for M_2_SQRTPIq? > > I don't think so. That's defined in libquadmath's quadmath.h, which is part > of GCC. Ah, that explains why I couldn't find the definition even in current git glibc :-) Rainer
diff --git a/libgfortran/intrinsics/erfc_scaled.c b/libgfortran/intrinsics/erfc_scaled.c --- a/libgfortran/intrinsics/erfc_scaled.c +++ b/libgfortran/intrinsics/erfc_scaled.c @@ -61,6 +61,9 @@ see the files COPYING3 and COPYING.RUNTI #else # define _THRESH -106.566990228185312813205074546585730L +# ifndef M_2_SQRTPIl +# define M_2_SQRTPIl 1.128379167095512573896158903121545172L +# endif # define _M_2_SQRTPI M_2_SQRTPIl # define _INF __builtin_infl() # ifdef HAVE_ERFCL