diff mbox series

Fix build with GCC 10 when long double = double [committed]

Message ID alpine.DEB.2.21.2003172258010.20204@digraph.polyomino.org.uk
State New
Headers show
Series Fix build with GCC 10 when long double = double [committed] | expand

Commit Message

Joseph Myers March 17, 2020, 10:58 p.m. UTC
On platforms where long double has the same ABI as double, glibc
defines long double functions as aliases for the corresponding double
functions.  The declarations of those functions in <math.h> are
disabled to avoid problems with aliases having incompatible types, but
GCC 10 now gives errors for incompatible types when the long double
function is known to GCC as a built-in function, not just when there
is an incompatible header declaration.

This patch fixes those errors by using appropriate
-fno-builtin-<function> options to compile the double functions.  The
list of CFLAGS-* settings is an appropriately adapted version of that
in sysdeps/ieee754/ldbl-opt/Makefile used there for building nldbl-*.c
files; in particular, the options are used even if GCC does not
currently have a built-in function of a given function, so that adding
such a built-in function in future will not break the glibc build.
Thus, various of the CFLAGS-* settings are only for future-proofing
and may not currently be needed (and it's possible some could be
irrelevant for other reasons).

Tested with build-many-glibcs.py for arm-linux-gnueabi (compilers and
glibcs builds), where it fixes the build that previously failed.

---

Committed.

Comments

Khem Raj March 26, 2020, 6:34 a.m. UTC | #1
Hi Joseph

I think this patch should be backported to 2.31 branch as well, so we
can keep release building with gcc trunk.

On Tue, Mar 17, 2020 at 3:59 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On platforms where long double has the same ABI as double, glibc
> defines long double functions as aliases for the corresponding double
> functions.  The declarations of those functions in <math.h> are
> disabled to avoid problems with aliases having incompatible types, but
> GCC 10 now gives errors for incompatible types when the long double
> function is known to GCC as a built-in function, not just when there
> is an incompatible header declaration.
>
> This patch fixes those errors by using appropriate
> -fno-builtin-<function> options to compile the double functions.  The
> list of CFLAGS-* settings is an appropriately adapted version of that
> in sysdeps/ieee754/ldbl-opt/Makefile used there for building nldbl-*.c
> files; in particular, the options are used even if GCC does not
> currently have a built-in function of a given function, so that adding
> such a built-in function in future will not break the glibc build.
> Thus, various of the CFLAGS-* settings are only for future-proofing
> and may not currently be needed (and it's possible some could be
> irrelevant for other reasons).
>
> Tested with build-many-glibcs.py for arm-linux-gnueabi (compilers and
> glibcs builds), where it fixes the build that previously failed.
>
> ---
>
> Committed.
>
> diff --git a/math/Makefile b/math/Makefile
> index 84a8b94c74..0a5a40430e 100644
> --- a/math/Makefile
> +++ b/math/Makefile
> @@ -650,6 +650,128 @@ ifneq ($(long-double-fcts),yes)
>  # We won't compile the `long double' code at all.  Tell the `double' code
>  # to define aliases for the `FUNCl' names.
>  math-CPPFLAGS += -DNO_LONG_DOUBLE
> +# GCC 10 diagnoses aliases with types conflicting with built-in
> +# functions.
> +CFLAGS-w_acos.c += -fno-builtin-acosl
> +CFLAGS-w_acosh.c += -fno-builtin-acoshl
> +CFLAGS-w_asin.c += -fno-builtin-asinl
> +CFLAGS-s_asinh.c += -fno-builtin-asinhl
> +CFLAGS-s_atan.c += -fno-builtin-atanl
> +CFLAGS-w_atan2.c += -fno-builtin-atan2l
> +CFLAGS-w_atanh.c += -fno-builtin-atanhl
> +CFLAGS-s_cabs.c += -fno-builtin-cabsl
> +CFLAGS-s_cacos.c += -fno-builtin-cacosl
> +CFLAGS-s_cacosh.c += -fno-builtin-cacoshl
> +CFLAGS-s_canonicalize.c += -fno-builtin-canonicalizel
> +CFLAGS-s_carg.c += -fno-builtin-cargl
> +CFLAGS-s_casin.c += -fno-builtin-casinl
> +CFLAGS-s_casinh.c += -fno-builtin-casinhl
> +CFLAGS-s_catan.c += -fno-builtin-catanl
> +CFLAGS-s_catanh.c += -fno-builtin-catanhl
> +CFLAGS-s_cbrt.c += -fno-builtin-cbrtl
> +CFLAGS-s_ccos.c += -fno-builtin-ccosl
> +CFLAGS-s_ccosh.c += -fno-builtin-ccoshl
> +CFLAGS-s_ceil.c += -fno-builtin-ceill
> +CFLAGS-s_cexp.c += -fno-builtin-cexpl
> +CFLAGS-s_cimag.c += -fno-builtin-cimagl
> +CFLAGS-s_clog.c += -fno-builtin-clogl
> +CFLAGS-s_clog10.c += -fno-builtin-clog10l
> +CFLAGS-s_conj.c += -fno-builtin-conjl
> +CFLAGS-s_copysign.c += -fno-builtin-copysignl
> +CFLAGS-s_cos.c += -fno-builtin-cosl
> +CFLAGS-w_cosh.c += -fno-builtin-coshl
> +CFLAGS-s_cpow.c += -fno-builtin-cpowl
> +CFLAGS-s_cproj.c += -fno-builtin-cprojl
> +CFLAGS-s_creal.c += -fno-builtin-creall
> +CFLAGS-s_csin.c += -fno-builtin-csinl
> +CFLAGS-s_csinh.c += -fno-builtin-csinhl
> +CFLAGS-s_csqrt.c += -fno-builtin-csqrtl
> +CFLAGS-s_ctan.c += -fno-builtin-ctanl
> +CFLAGS-s_ctanh.c += -fno-builtin-ctanhl
> +CFLAGS-s_dadd.c += -fno-builtin-daddl
> +CFLAGS-s_ddiv.c += -fno-builtin-ddivl
> +CFLAGS-s_dmul.c += -fno-builtin-dmull
> +CFLAGS-s_dsub.c += -fno-builtin-dsubl
> +CFLAGS-s_erf.c += -fno-builtin-erfl
> +CFLAGS-s_erfc.c += -fno-builtin-erfcl
> +CFLAGS-e_exp.c += -fno-builtin-expl
> +CFLAGS-w_exp10.c += -fno-builtin-exp10l
> +CFLAGS-e_exp2.c += -fno-builtin-exp2l
> +CFLAGS-s_expm1.c += -fno-builtin-expm1l
> +CFLAGS-s_fabs.c += -fno-builtin-fabsl
> +CFLAGS-s_fadd.c += -fno-builtin-faddl
> +CFLAGS-s_fdim.c += -fno-builtin-fdiml
> +CFLAGS-s_fdiv.c += -fno-builtin-fdivl
> +CFLAGS-s_finite.c += -fno-builtin-finitel
> +CFLAGS-s_floor.c += -fno-builtin-floorl
> +CFLAGS-s_fma.c += -fno-builtin-fmal
> +CFLAGS-s_fmax.c += -fno-builtin-fmaxl
> +CFLAGS-s_fmaxmag.c += -fno-builtin-fmaxmagl
> +CFLAGS-s_fmin.c += -fno-builtin-fminl
> +CFLAGS-s_fminmag.c += -fno-builtin-fminmagl
> +CFLAGS-w_fmod.c += -fno-builtin-fmodl
> +CFLAGS-s_fmul.c += -fno-builtin-fmull
> +CFLAGS-s_frexp.c += -fno-builtin-frexpl
> +CFLAGS-s_fromfp.c += -fno-builtin-fromfpl
> +CFLAGS-s_fromfpx.c += -fno-builtin-fromfpxl
> +CFLAGS-s_fsub.c += -fno-builtin-fsubl
> +CFLAGS-s_gamma.c += -fno-builtin-gammal
> +CFLAGS-s_getpayload.c += -fno-builtin-getpayloadl
> +CFLAGS-w_hypot.c += -fno-builtin-hypotl
> +CFLAGS-w_ilogb.c += -fno-builtin-ilogbl
> +CFLAGS-s_isinf.c += -fno-builtin-isinfl
> +CFLAGS-s_isnan.c += -fno-builtin-isnanl
> +CFLAGS-w_j0.c += -fno-builtin-j0l
> +CFLAGS-w_j1.c += -fno-builtin-j1l
> +CFLAGS-w_jn.c += -fno-builtin-jnl
> +CFLAGS-s_ldexp.c += -fno-builtin-ldexpl
> +CFLAGS-w_lgamma.c += -fno-builtin-lgammal
> +CFLAGS-w_lgamma_r.c += -fno-builtin-lgammal_r
> +CFLAGS-w_llogb.c += -fno-builtin-llogbl
> +CFLAGS-s_llrint.c += -fno-builtin-llrintl
> +CFLAGS-s_llround.c += -fno-builtin-llroundl
> +CFLAGS-e_log.c += -fno-builtin-logl
> +CFLAGS-w_log10.c += -fno-builtin-log10l
> +CFLAGS-w_log1p.c += -fno-builtin-log1pl
> +CFLAGS-e_log2.c += -fno-builtin-log2l
> +CFLAGS-s_logb.c += -fno-builtin-logbl
> +CFLAGS-s_lrint.c += -fno-builtin-lrintl
> +CFLAGS-s_lround.c += -fno-builtin-lroundl
> +CFLAGS-s_modf.c += -fno-builtin-modfl
> +CFLAGS-s_nan.c += -fno-builtin-nanl
> +CFLAGS-s_nearbyint.c += -fno-builtin-nearbyintl
> +CFLAGS-s_nextafter.c += -fno-builtin-nextafterl
> +CFLAGS-s_nextdown.c += -fno-builtin-nextdownl
> +CFLAGS-s_nexttoward.c += -fno-builtin-nexttoward -fno-builtin-nexttowardl
> +CFLAGS-s_nexttowardf.c += -fno-builtin-nexttowardf
> +CFLAGS-s_nextup.c += -fno-builtin-nextupl
> +CFLAGS-e_pow.c += -fno-builtin-powl
> +CFLAGS-w_remainder.c += -fno-builtin-remainderl -fno-builtin-dreml
> +CFLAGS-s_remquo.c += -fno-builtin-remquol
> +CFLAGS-s_rint.c += -fno-builtin-rintl
> +CFLAGS-s_round.c += -fno-builtin-roundl
> +CFLAGS-s_roundeven.c += -fno-builtin-roundevenl
> +CFLAGS-w_scalb.c += -fno-builtin-scalbl
> +CFLAGS-w_scalbln.c += -fno-builtin-scalblnl
> +CFLAGS-s_scalbn.c += -fno-builtin-scalbnl
> +CFLAGS-s_setpayload.c += -fno-builtin-setpayloadl
> +CFLAGS-s_setpayloadsig.c += -fno-builtin-setpayloadsigl
> +CFLAGS-s_significand.c += -fno-builtin-significandl
> +CFLAGS-s_sin.c += -fno-builtin-sinl
> +CFLAGS-s_sincos.c += -fno-builtin-sincosl
> +CFLAGS-w_sinh.c += -fno-builtin-sinhl
> +CFLAGS-w_sqrt.c += -fno-builtin-sqrtl
> +CFLAGS-s_tan.c += -fno-builtin-tanl
> +CFLAGS-s_tanh.c += -fno-builtin-tanhl
> +CFLAGS-w_tgamma.c += -fno-builtin-tgammal
> +CFLAGS-s_totalorder.c += -fno-builtin-totalorderl
> +CFLAGS-s_totalordermag.c += -fno-builtin-totalordermagl
> +CFLAGS-s_trunc.c += -fno-builtin-truncl
> +CFLAGS-s_ufromfp.c += -fno-builtin-ufromfpl
> +CFLAGS-s_ufromfpx.c += -fno-builtin-ufromfpxl
> +CFLAGS-s_y0.c += -fno-builtin-y0l
> +CFLAGS-s_y1.c += -fno-builtin-y1l
> +CFLAGS-s_yn.c += -fno-builtin-ynl
>  endif
>
>  # These files quiet sNaNs in a way that is optimized away without
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
Vasee Vinayagamoorthy May 4, 2020, 10:51 a.m. UTC | #2
Hi Joseph,

I also think that we need this patch backported to glibc 2.31 branch 
because we are seeing failures for arm-none-linux-gnueabihf target when 
building GCC 10 with glibc 2.31:

error: conflicting types for built-in function 'modfl'; 
expected 'long double(long double,  long double *)' 
[-Werror=builtin-declaration-mismatch]


Kind Regards
Vasee

On Wed, Mar 25, 2020 at 11:34:22PM -0700, Khem Raj via Libc-alpha wrote:
> Hi Joseph
> 
> I think this patch should be backported to 2.31 branch as well, so we
> can keep release building with gcc trunk.
> 
> On Tue, Mar 17, 2020 at 3:59 PM Joseph Myers <joseph@codesourcery.com> wrote:
> >
> > On platforms where long double has the same ABI as double, glibc
> > defines long double functions as aliases for the corresponding double
> > functions.  The declarations of those functions in <math.h> are
> > disabled to avoid problems with aliases having incompatible types, but
> > GCC 10 now gives errors for incompatible types when the long double
> > function is known to GCC as a built-in function, not just when there
> > is an incompatible header declaration.
> >
> > This patch fixes those errors by using appropriate
> > -fno-builtin-<function> options to compile the double functions.  The
> > list of CFLAGS-* settings is an appropriately adapted version of that
> > in sysdeps/ieee754/ldbl-opt/Makefile used there for building nldbl-*.c
> > files; in particular, the options are used even if GCC does not
> > currently have a built-in function of a given function, so that adding
> > such a built-in function in future will not break the glibc build.
> > Thus, various of the CFLAGS-* settings are only for future-proofing
> > and may not currently be needed (and it's possible some could be
> > irrelevant for other reasons).
> >
> > Tested with build-many-glibcs.py for arm-linux-gnueabi (compilers and
> > glibcs builds), where it fixes the build that previously failed.
> >
> > ---
> >
> > Committed.
> >
> > diff --git a/math/Makefile b/math/Makefile
> > index 84a8b94c74..0a5a40430e 100644
> > --- a/math/Makefile
> > +++ b/math/Makefile
> > @@ -650,6 +650,128 @@ ifneq ($(long-double-fcts),yes)
> >  # We won't compile the `long double' code at all.  Tell the `double' code
> >  # to define aliases for the `FUNCl' names.
> >  math-CPPFLAGS += -DNO_LONG_DOUBLE
> > +# GCC 10 diagnoses aliases with types conflicting with built-in
> > +# functions.
> > +CFLAGS-w_acos.c += -fno-builtin-acosl
> > +CFLAGS-w_acosh.c += -fno-builtin-acoshl
> > +CFLAGS-w_asin.c += -fno-builtin-asinl
> > +CFLAGS-s_asinh.c += -fno-builtin-asinhl
> > +CFLAGS-s_atan.c += -fno-builtin-atanl
> > +CFLAGS-w_atan2.c += -fno-builtin-atan2l
> > +CFLAGS-w_atanh.c += -fno-builtin-atanhl
> > +CFLAGS-s_cabs.c += -fno-builtin-cabsl
> > +CFLAGS-s_cacos.c += -fno-builtin-cacosl
> > +CFLAGS-s_cacosh.c += -fno-builtin-cacoshl
> > +CFLAGS-s_canonicalize.c += -fno-builtin-canonicalizel
> > +CFLAGS-s_carg.c += -fno-builtin-cargl
> > +CFLAGS-s_casin.c += -fno-builtin-casinl
> > +CFLAGS-s_casinh.c += -fno-builtin-casinhl
> > +CFLAGS-s_catan.c += -fno-builtin-catanl
> > +CFLAGS-s_catanh.c += -fno-builtin-catanhl
> > +CFLAGS-s_cbrt.c += -fno-builtin-cbrtl
> > +CFLAGS-s_ccos.c += -fno-builtin-ccosl
> > +CFLAGS-s_ccosh.c += -fno-builtin-ccoshl
> > +CFLAGS-s_ceil.c += -fno-builtin-ceill
> > +CFLAGS-s_cexp.c += -fno-builtin-cexpl
> > +CFLAGS-s_cimag.c += -fno-builtin-cimagl
> > +CFLAGS-s_clog.c += -fno-builtin-clogl
> > +CFLAGS-s_clog10.c += -fno-builtin-clog10l
> > +CFLAGS-s_conj.c += -fno-builtin-conjl
> > +CFLAGS-s_copysign.c += -fno-builtin-copysignl
> > +CFLAGS-s_cos.c += -fno-builtin-cosl
> > +CFLAGS-w_cosh.c += -fno-builtin-coshl
> > +CFLAGS-s_cpow.c += -fno-builtin-cpowl
> > +CFLAGS-s_cproj.c += -fno-builtin-cprojl
> > +CFLAGS-s_creal.c += -fno-builtin-creall
> > +CFLAGS-s_csin.c += -fno-builtin-csinl
> > +CFLAGS-s_csinh.c += -fno-builtin-csinhl
> > +CFLAGS-s_csqrt.c += -fno-builtin-csqrtl
> > +CFLAGS-s_ctan.c += -fno-builtin-ctanl
> > +CFLAGS-s_ctanh.c += -fno-builtin-ctanhl
> > +CFLAGS-s_dadd.c += -fno-builtin-daddl
> > +CFLAGS-s_ddiv.c += -fno-builtin-ddivl
> > +CFLAGS-s_dmul.c += -fno-builtin-dmull
> > +CFLAGS-s_dsub.c += -fno-builtin-dsubl
> > +CFLAGS-s_erf.c += -fno-builtin-erfl
> > +CFLAGS-s_erfc.c += -fno-builtin-erfcl
> > +CFLAGS-e_exp.c += -fno-builtin-expl
> > +CFLAGS-w_exp10.c += -fno-builtin-exp10l
> > +CFLAGS-e_exp2.c += -fno-builtin-exp2l
> > +CFLAGS-s_expm1.c += -fno-builtin-expm1l
> > +CFLAGS-s_fabs.c += -fno-builtin-fabsl
> > +CFLAGS-s_fadd.c += -fno-builtin-faddl
> > +CFLAGS-s_fdim.c += -fno-builtin-fdiml
> > +CFLAGS-s_fdiv.c += -fno-builtin-fdivl
> > +CFLAGS-s_finite.c += -fno-builtin-finitel
> > +CFLAGS-s_floor.c += -fno-builtin-floorl
> > +CFLAGS-s_fma.c += -fno-builtin-fmal
> > +CFLAGS-s_fmax.c += -fno-builtin-fmaxl
> > +CFLAGS-s_fmaxmag.c += -fno-builtin-fmaxmagl
> > +CFLAGS-s_fmin.c += -fno-builtin-fminl
> > +CFLAGS-s_fminmag.c += -fno-builtin-fminmagl
> > +CFLAGS-w_fmod.c += -fno-builtin-fmodl
> > +CFLAGS-s_fmul.c += -fno-builtin-fmull
> > +CFLAGS-s_frexp.c += -fno-builtin-frexpl
> > +CFLAGS-s_fromfp.c += -fno-builtin-fromfpl
> > +CFLAGS-s_fromfpx.c += -fno-builtin-fromfpxl
> > +CFLAGS-s_fsub.c += -fno-builtin-fsubl
> > +CFLAGS-s_gamma.c += -fno-builtin-gammal
> > +CFLAGS-s_getpayload.c += -fno-builtin-getpayloadl
> > +CFLAGS-w_hypot.c += -fno-builtin-hypotl
> > +CFLAGS-w_ilogb.c += -fno-builtin-ilogbl
> > +CFLAGS-s_isinf.c += -fno-builtin-isinfl
> > +CFLAGS-s_isnan.c += -fno-builtin-isnanl
> > +CFLAGS-w_j0.c += -fno-builtin-j0l
> > +CFLAGS-w_j1.c += -fno-builtin-j1l
> > +CFLAGS-w_jn.c += -fno-builtin-jnl
> > +CFLAGS-s_ldexp.c += -fno-builtin-ldexpl
> > +CFLAGS-w_lgamma.c += -fno-builtin-lgammal
> > +CFLAGS-w_lgamma_r.c += -fno-builtin-lgammal_r
> > +CFLAGS-w_llogb.c += -fno-builtin-llogbl
> > +CFLAGS-s_llrint.c += -fno-builtin-llrintl
> > +CFLAGS-s_llround.c += -fno-builtin-llroundl
> > +CFLAGS-e_log.c += -fno-builtin-logl
> > +CFLAGS-w_log10.c += -fno-builtin-log10l
> > +CFLAGS-w_log1p.c += -fno-builtin-log1pl
> > +CFLAGS-e_log2.c += -fno-builtin-log2l
> > +CFLAGS-s_logb.c += -fno-builtin-logbl
> > +CFLAGS-s_lrint.c += -fno-builtin-lrintl
> > +CFLAGS-s_lround.c += -fno-builtin-lroundl
> > +CFLAGS-s_modf.c += -fno-builtin-modfl
> > +CFLAGS-s_nan.c += -fno-builtin-nanl
> > +CFLAGS-s_nearbyint.c += -fno-builtin-nearbyintl
> > +CFLAGS-s_nextafter.c += -fno-builtin-nextafterl
> > +CFLAGS-s_nextdown.c += -fno-builtin-nextdownl
> > +CFLAGS-s_nexttoward.c += -fno-builtin-nexttoward -fno-builtin-nexttowardl
> > +CFLAGS-s_nexttowardf.c += -fno-builtin-nexttowardf
> > +CFLAGS-s_nextup.c += -fno-builtin-nextupl
> > +CFLAGS-e_pow.c += -fno-builtin-powl
> > +CFLAGS-w_remainder.c += -fno-builtin-remainderl -fno-builtin-dreml
> > +CFLAGS-s_remquo.c += -fno-builtin-remquol
> > +CFLAGS-s_rint.c += -fno-builtin-rintl
> > +CFLAGS-s_round.c += -fno-builtin-roundl
> > +CFLAGS-s_roundeven.c += -fno-builtin-roundevenl
> > +CFLAGS-w_scalb.c += -fno-builtin-scalbl
> > +CFLAGS-w_scalbln.c += -fno-builtin-scalblnl
> > +CFLAGS-s_scalbn.c += -fno-builtin-scalbnl
> > +CFLAGS-s_setpayload.c += -fno-builtin-setpayloadl
> > +CFLAGS-s_setpayloadsig.c += -fno-builtin-setpayloadsigl
> > +CFLAGS-s_significand.c += -fno-builtin-significandl
> > +CFLAGS-s_sin.c += -fno-builtin-sinl
> > +CFLAGS-s_sincos.c += -fno-builtin-sincosl
> > +CFLAGS-w_sinh.c += -fno-builtin-sinhl
> > +CFLAGS-w_sqrt.c += -fno-builtin-sqrtl
> > +CFLAGS-s_tan.c += -fno-builtin-tanl
> > +CFLAGS-s_tanh.c += -fno-builtin-tanhl
> > +CFLAGS-w_tgamma.c += -fno-builtin-tgammal
> > +CFLAGS-s_totalorder.c += -fno-builtin-totalorderl
> > +CFLAGS-s_totalordermag.c += -fno-builtin-totalordermagl
> > +CFLAGS-s_trunc.c += -fno-builtin-truncl
> > +CFLAGS-s_ufromfp.c += -fno-builtin-ufromfpl
> > +CFLAGS-s_ufromfpx.c += -fno-builtin-ufromfpxl
> > +CFLAGS-s_y0.c += -fno-builtin-y0l
> > +CFLAGS-s_y1.c += -fno-builtin-y1l
> > +CFLAGS-s_yn.c += -fno-builtin-ynl
> >  endif
> >
> >  # These files quiet sNaNs in a way that is optimized away without
> >
> > --
> > Joseph S. Myers
> > joseph@codesourcery.com
Joseph Myers May 4, 2020, 8:26 p.m. UTC | #3
On Mon, 4 May 2020, Vasee Vinayagamoorthy wrote:

> Hi Joseph,
> 
> I also think that we need this patch backported to glibc 2.31 branch 
> because we are seeing failures for arm-none-linux-gnueabihf target when 
> building GCC 10 with glibc 2.31:

Anyone who wishes to build older glibc versions with newer compilers 
should feel free to cherry-pick relevant commits to the release branches 
following the usual release-branch process 
<https://sourceware.org/glibc/wiki/Release#General_policy>, discussing the 
proposed changes on libc-stable as necessary.  I don't tend to backport 
non-regression fixes myself unless I have an actual use for the fix on an 
older branch.
diff mbox series

Patch

diff --git a/math/Makefile b/math/Makefile
index 84a8b94c74..0a5a40430e 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -650,6 +650,128 @@  ifneq ($(long-double-fcts),yes)
 # We won't compile the `long double' code at all.  Tell the `double' code
 # to define aliases for the `FUNCl' names.
 math-CPPFLAGS += -DNO_LONG_DOUBLE
+# GCC 10 diagnoses aliases with types conflicting with built-in
+# functions.
+CFLAGS-w_acos.c += -fno-builtin-acosl
+CFLAGS-w_acosh.c += -fno-builtin-acoshl
+CFLAGS-w_asin.c += -fno-builtin-asinl
+CFLAGS-s_asinh.c += -fno-builtin-asinhl
+CFLAGS-s_atan.c += -fno-builtin-atanl
+CFLAGS-w_atan2.c += -fno-builtin-atan2l
+CFLAGS-w_atanh.c += -fno-builtin-atanhl
+CFLAGS-s_cabs.c += -fno-builtin-cabsl
+CFLAGS-s_cacos.c += -fno-builtin-cacosl
+CFLAGS-s_cacosh.c += -fno-builtin-cacoshl
+CFLAGS-s_canonicalize.c += -fno-builtin-canonicalizel
+CFLAGS-s_carg.c += -fno-builtin-cargl
+CFLAGS-s_casin.c += -fno-builtin-casinl
+CFLAGS-s_casinh.c += -fno-builtin-casinhl
+CFLAGS-s_catan.c += -fno-builtin-catanl
+CFLAGS-s_catanh.c += -fno-builtin-catanhl
+CFLAGS-s_cbrt.c += -fno-builtin-cbrtl
+CFLAGS-s_ccos.c += -fno-builtin-ccosl
+CFLAGS-s_ccosh.c += -fno-builtin-ccoshl
+CFLAGS-s_ceil.c += -fno-builtin-ceill
+CFLAGS-s_cexp.c += -fno-builtin-cexpl
+CFLAGS-s_cimag.c += -fno-builtin-cimagl
+CFLAGS-s_clog.c += -fno-builtin-clogl
+CFLAGS-s_clog10.c += -fno-builtin-clog10l
+CFLAGS-s_conj.c += -fno-builtin-conjl
+CFLAGS-s_copysign.c += -fno-builtin-copysignl
+CFLAGS-s_cos.c += -fno-builtin-cosl
+CFLAGS-w_cosh.c += -fno-builtin-coshl
+CFLAGS-s_cpow.c += -fno-builtin-cpowl
+CFLAGS-s_cproj.c += -fno-builtin-cprojl
+CFLAGS-s_creal.c += -fno-builtin-creall
+CFLAGS-s_csin.c += -fno-builtin-csinl
+CFLAGS-s_csinh.c += -fno-builtin-csinhl
+CFLAGS-s_csqrt.c += -fno-builtin-csqrtl
+CFLAGS-s_ctan.c += -fno-builtin-ctanl
+CFLAGS-s_ctanh.c += -fno-builtin-ctanhl
+CFLAGS-s_dadd.c += -fno-builtin-daddl
+CFLAGS-s_ddiv.c += -fno-builtin-ddivl
+CFLAGS-s_dmul.c += -fno-builtin-dmull
+CFLAGS-s_dsub.c += -fno-builtin-dsubl
+CFLAGS-s_erf.c += -fno-builtin-erfl
+CFLAGS-s_erfc.c += -fno-builtin-erfcl
+CFLAGS-e_exp.c += -fno-builtin-expl
+CFLAGS-w_exp10.c += -fno-builtin-exp10l
+CFLAGS-e_exp2.c += -fno-builtin-exp2l
+CFLAGS-s_expm1.c += -fno-builtin-expm1l
+CFLAGS-s_fabs.c += -fno-builtin-fabsl
+CFLAGS-s_fadd.c += -fno-builtin-faddl
+CFLAGS-s_fdim.c += -fno-builtin-fdiml
+CFLAGS-s_fdiv.c += -fno-builtin-fdivl
+CFLAGS-s_finite.c += -fno-builtin-finitel
+CFLAGS-s_floor.c += -fno-builtin-floorl
+CFLAGS-s_fma.c += -fno-builtin-fmal
+CFLAGS-s_fmax.c += -fno-builtin-fmaxl
+CFLAGS-s_fmaxmag.c += -fno-builtin-fmaxmagl
+CFLAGS-s_fmin.c += -fno-builtin-fminl
+CFLAGS-s_fminmag.c += -fno-builtin-fminmagl
+CFLAGS-w_fmod.c += -fno-builtin-fmodl
+CFLAGS-s_fmul.c += -fno-builtin-fmull
+CFLAGS-s_frexp.c += -fno-builtin-frexpl
+CFLAGS-s_fromfp.c += -fno-builtin-fromfpl
+CFLAGS-s_fromfpx.c += -fno-builtin-fromfpxl
+CFLAGS-s_fsub.c += -fno-builtin-fsubl
+CFLAGS-s_gamma.c += -fno-builtin-gammal
+CFLAGS-s_getpayload.c += -fno-builtin-getpayloadl
+CFLAGS-w_hypot.c += -fno-builtin-hypotl
+CFLAGS-w_ilogb.c += -fno-builtin-ilogbl
+CFLAGS-s_isinf.c += -fno-builtin-isinfl
+CFLAGS-s_isnan.c += -fno-builtin-isnanl
+CFLAGS-w_j0.c += -fno-builtin-j0l
+CFLAGS-w_j1.c += -fno-builtin-j1l
+CFLAGS-w_jn.c += -fno-builtin-jnl
+CFLAGS-s_ldexp.c += -fno-builtin-ldexpl
+CFLAGS-w_lgamma.c += -fno-builtin-lgammal
+CFLAGS-w_lgamma_r.c += -fno-builtin-lgammal_r
+CFLAGS-w_llogb.c += -fno-builtin-llogbl
+CFLAGS-s_llrint.c += -fno-builtin-llrintl
+CFLAGS-s_llround.c += -fno-builtin-llroundl
+CFLAGS-e_log.c += -fno-builtin-logl
+CFLAGS-w_log10.c += -fno-builtin-log10l
+CFLAGS-w_log1p.c += -fno-builtin-log1pl
+CFLAGS-e_log2.c += -fno-builtin-log2l
+CFLAGS-s_logb.c += -fno-builtin-logbl
+CFLAGS-s_lrint.c += -fno-builtin-lrintl
+CFLAGS-s_lround.c += -fno-builtin-lroundl
+CFLAGS-s_modf.c += -fno-builtin-modfl
+CFLAGS-s_nan.c += -fno-builtin-nanl
+CFLAGS-s_nearbyint.c += -fno-builtin-nearbyintl
+CFLAGS-s_nextafter.c += -fno-builtin-nextafterl
+CFLAGS-s_nextdown.c += -fno-builtin-nextdownl
+CFLAGS-s_nexttoward.c += -fno-builtin-nexttoward -fno-builtin-nexttowardl
+CFLAGS-s_nexttowardf.c += -fno-builtin-nexttowardf
+CFLAGS-s_nextup.c += -fno-builtin-nextupl
+CFLAGS-e_pow.c += -fno-builtin-powl
+CFLAGS-w_remainder.c += -fno-builtin-remainderl -fno-builtin-dreml
+CFLAGS-s_remquo.c += -fno-builtin-remquol
+CFLAGS-s_rint.c += -fno-builtin-rintl
+CFLAGS-s_round.c += -fno-builtin-roundl
+CFLAGS-s_roundeven.c += -fno-builtin-roundevenl
+CFLAGS-w_scalb.c += -fno-builtin-scalbl
+CFLAGS-w_scalbln.c += -fno-builtin-scalblnl
+CFLAGS-s_scalbn.c += -fno-builtin-scalbnl
+CFLAGS-s_setpayload.c += -fno-builtin-setpayloadl
+CFLAGS-s_setpayloadsig.c += -fno-builtin-setpayloadsigl
+CFLAGS-s_significand.c += -fno-builtin-significandl
+CFLAGS-s_sin.c += -fno-builtin-sinl
+CFLAGS-s_sincos.c += -fno-builtin-sincosl
+CFLAGS-w_sinh.c += -fno-builtin-sinhl
+CFLAGS-w_sqrt.c += -fno-builtin-sqrtl
+CFLAGS-s_tan.c += -fno-builtin-tanl
+CFLAGS-s_tanh.c += -fno-builtin-tanhl
+CFLAGS-w_tgamma.c += -fno-builtin-tgammal
+CFLAGS-s_totalorder.c += -fno-builtin-totalorderl
+CFLAGS-s_totalordermag.c += -fno-builtin-totalordermagl
+CFLAGS-s_trunc.c += -fno-builtin-truncl
+CFLAGS-s_ufromfp.c += -fno-builtin-ufromfpl
+CFLAGS-s_ufromfpx.c += -fno-builtin-ufromfpxl
+CFLAGS-s_y0.c += -fno-builtin-y0l
+CFLAGS-s_y1.c += -fno-builtin-y1l
+CFLAGS-s_yn.c += -fno-builtin-ynl
 endif
 
 # These files quiet sNaNs in a way that is optimized away without