Checked on x86_64-linux-gnu.
Reviewed-by: Sam James <sam@gentoo.org>
config_vars="$config_vars
have-test-cc-gcs = $libc_cv_test_cc_gcs"
+# Check if compiler supports -fno-fp-int-builtin-inexact
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler supports -fno-fp-int-builtin-inexact" >&5
+printf %s "checking if compiler supports -fno-fp-int-builtin-inexact... " >&6; }
+if test ${libc_cv_cc_no_fp_builtin_inexact+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if { ac_try='${CC-cc} -Werror -fno-fp-int-builtin-inexact -xc /dev/null -S -o /dev/null'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+then :
+ libc_cv_cc_no_fp_builtin_inexact=-fno-fp-int-builtin-inexact
+else case e in #(
+ e) libc_cv_cc_no_fp_builtin_inexact= ;;
+esac
+fi ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_no_fp_builtin_inexact" >&5
+printf "%s\n" "$libc_cv_cc_no_fp_builtin_inexact" >&6; }
+if test "$TEST_CC" = "$CC"; then
+ libc_cv_test_cc_no_fp_builtin_inexact=$libc_cv_cc_no_fp_builtin_inexact
+else
+
+saved_CC="$CC"
+CC="$TEST_CC"
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler supports -fno-fp-int-builtin-inexact in testing" >&5
+printf %s "checking if compiler supports -fno-fp-int-builtin-inexact in testing... " >&6; }
+if test ${libc_cv_test_cc_no_fp_builtin_inexact+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if { ac_try='${CC-cc} -Werror -fno-fp-int-builtin-inexact -xc /dev/null -S -o /dev/null'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+then :
+ libc_cv_test_cc_no_fp_builtin_inexact=-fno-fp-int-builtin-inexact
+else case e in #(
+ e) libc_cv_test_cc_no_fp_builtin_inexact= ;;
+esac
+fi ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_test_cc_no_fp_builtin_inexact" >&5
+printf "%s\n" "$libc_cv_test_cc_no_fp_builtin_inexact" >&6; }
+
+CC="$saved_CC"
+
+fi
+
+config_vars="$config_vars
+config-cflags-no-fp-builtin-inexact = $libc_cv_cc_no_fp_builtin_inexact"
+
# Check if linker supports GCS marking
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z gcs=always" >&5
printf %s "checking for linker that supports -z gcs=always... " >&6; }
LIBC_CONFIG_VAR([have-cc-gcs], [$libc_cv_cc_gcs])
LIBC_CONFIG_VAR([have-test-cc-gcs], [$libc_cv_test_cc_gcs])
+# Check if compiler supports -fno-fp-int-builtin-inexact
+LIBC_TRY_CC_AND_TEST_CC_OPTION([if compiler supports -fno-fp-int-builtin-inexact],
+ [-Werror -fno-fp-int-builtin-inexact],
+ libc_cv_cc_no_fp_builtin_inexact,
+ [libc_cv_cc_no_fp_builtin_inexact=-fno-fp-int-builtin-inexact],
+ [libc_cv_cc_no_fp_builtin_inexact=],
+ libc_cv_test_cc_no_fp_builtin_inexact,
+ [libc_cv_test_cc_no_fp_builtin_inexact=-fno-fp-int-builtin-inexact],
+ [libc_cv_test_cc_no_fp_builtin_inexact=])
+LIBC_CONFIG_VAR([config-cflags-no-fp-builtin-inexact], [$libc_cv_cc_no_fp_builtin_inexact])
+
# Check if linker supports GCS marking
LIBC_LINKER_FEATURE([-z gcs=always], [-Wl,-z,gcs=always],
[libc_cv_ld_gcs=yes], [libc_cv_ld_gcs=no])
# These files rely on C23 semantics for avoiding "inexact" exceptions
# from rounding functions. These settings can be removed when glibc
# builds with -std=gnu23 or later.
-CFLAGS-s_fromfp.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_fromfpx.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_ufromfp.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_ufromfpx.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_fromfpf.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_fromfpxf.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_ufromfpf.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_ufromfpxf.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_fromfpl.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_fromfpxl.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_ufromfpl.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_ufromfpxl.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_fromfpf128.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_fromfpxf128.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_ufromfpf128.c += -fno-fp-int-builtin-inexact
-CFLAGS-s_ufromfpxf128.c += -fno-fp-int-builtin-inexact
+CFLAGS-s_fromfp.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_fromfpx.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_ufromfp.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_ufromfpx.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_fromfpf.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_fromfpxf.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_ufromfpf.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_ufromfpxf.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_fromfpl.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_fromfpxl.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_ufromfpl.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_ufromfpxl.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_fromfpf128.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_fromfpxf128.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_ufromfpf128.c += $(config-cflags-no-fp-builtin-inexact)
+CFLAGS-s_ufromfpxf128.c += $(config-cflags-no-fp-builtin-inexact)
$(addprefix $(objpfx),\
$(filter-out $(tests-static) $(libm-tests-vector),\