]> git.ipfire.org Git - thirdparty/glibc.git/commit
Fix build with GCC 10 when long double = double.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 17 Mar 2020 22:57:42 +0000 (22:57 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 17 Mar 2020 22:57:42 +0000 (22:57 +0000)
commit49348beafe9ba150c9bd48595b3f372299bddbb0
tree0cbdc15f875aac8bec4e3f2a719930a5ca5b26bf
parentcbd156990489568eb8c1b97ace3ad24fc784e049
Fix build with GCC 10 when long double = double.

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.
math/Makefile