about summary refs log tree commit diff
path: root/sysdeps/x86_64/Makefile
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2018-08-01 22:22:00 +0000
committerJoseph Myers <joseph@codesourcery.com>2018-08-01 22:22:00 +0000
commitf6dcefbe607e7c190388c11db0a80a80e6ce9686 (patch)
tree99803e519b2b6558b404e2c4b03bcfcaa59a3e50 /sysdeps/x86_64/Makefile
parentfa67ba06ee07845a2bac34afa609ee2bbb1e017e (diff)
downloadglibc-f6dcefbe607e7c190388c11db0a80a80e6ce9686.tar.gz
glibc-f6dcefbe607e7c190388c11db0a80a80e6ce9686.tar.xz
glibc-f6dcefbe607e7c190388c11db0a80a80e6ce9686.zip
Fix math/test-misc.c for undefined fenv.h macros.
math/test-misc.c contains some code that uses fenv.h macros
FE_UNDERFLOW, FE_OVERFLOW and FE_UPWARD without being conditional on
those macros being defined.

That would normally break the build for configurations (typically
soft-float) not defining those macros.  However, the code in question
is inside LDBL_MANT_DIG > DBL_MANT_DIG conditionals.  And, while we
have configurations lacking rounding mode and exception support where
LDBL_MANT_DIG > DBL_MANT_DIG (soft-float MIPS64 and RISC-V), those
configurations currently define the fenv.h macros in question even for
soft-float.

There may be some case for defining those macros in cases where a
soft-float compilation could use a hard-float libm (where both
soft-float and hard-float can use the same ABI, as on ARM and RISC-V,
for example).  But MIPS is not such a case - the hard-float and
soft-float ABIs are incompatible - and thus I am testing a patch to
stop defining those macros for soft-float MIPS (motivated by reducing
the extent to which architectures need their own definitions of
math-tests.h macros - if lack of rounding mode / exception support can
be determined by the lack of macros in fenv.h, that avoids the need
for math-tests.h to declare that lack as well).  Introducing a case of
LDBL_MANT_DIG > DBL_MANT_DIG without these macros defined shows up the
problem with math/test-misc.c.  This patch then fixes that problem by
adding appropriate conditionals.

Tested for MIPS64 in conjunction with changes to stop defining the
macros in question in bits/fenv.h for soft-float.

	* math/test-misc.c (do_test) [LDBL_MANT_DIG > DBL_MANT_DIG]: Make
	code using FE_UNDERFLOW conditional on [FE_UNDERFLOW], code using
	FE_OVERFLOW conditional on [FE_OVERFLOW] and code using FE_UPWARD
	conditional on [FE_UPWARD].
Diffstat (limited to 'sysdeps/x86_64/Makefile')
0 files changed, 0 insertions, 0 deletions