Build glibc with -ftrapping-math

GCC enables it by default, clang in the other hand sets -fno-trapping-math.
This is required to fix some math and stdlib tests that explicit raises
floating point exceptions (i.e. stdlib/tst-strtod-round on aarch64).
This commit is contained in:
Adhemerval Zanella 2024-02-15 08:58:46 -03:00
parent c72809e0d8
commit 8565bb7763

View File

@ -883,6 +883,9 @@ endif
# disable any optimization that assume default rounding mode.
+math-flags = $(config-cflags-frounding-math)
# We have to assume that glibc functions might generate user-visible traps.
+math-flags += -ftrapping-math
# Logically only "libnldbl", "nonlib" and "testsuite" should be using
# -fno-math-errno. However due to GCC bug #88576, only "libm" can use
# -fno-math-errno.