aboutsummaryrefslogtreecommitdiff
path: root/libgcc/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'libgcc/configure.ac')
-rw-r--r--libgcc/configure.ac33
1 files changed, 33 insertions, 0 deletions
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index 710f15a..79d0ea4 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -320,6 +320,25 @@ mips*-*-*)
[libgcc_cv_mips_hard_float=no])])
esac
+# Determine the version of glibc, if any, used on the target.
+AC_MSG_CHECKING([for target glibc version])
+AC_ARG_WITH([glibc-version],
+ [AS_HELP_STRING([--with-glibc-version=M.N],
+ [assume GCC used with glibc version M.N or later])], [
+if [echo "$with_glibc_version" | grep '^[0-9][0-9]*\.[0-9][0-9]*$']; then
+ glibc_version_major=`echo "$with_glibc_version" | sed -e 's/\..*//'`
+ glibc_version_minor=`echo "$with_glibc_version" | sed -e 's/.*\.//'`
+else
+ AC_MSG_ERROR([option --with-glibc-version requires a version number M.N])
+fi], [
+AC_COMPUTE_INT([glibc_version_major], [__GLIBC__],
+ [#include <features.h>],
+ [glibc_version_major=0])
+AC_COMPUTE_INT([glibc_version_minor], [__GLIBC_MINOR__],
+ [#include <features.h>],
+ [glibc_version_minor=0])])
+AC_MSG_RESULT([$glibc_version_major.$glibc_version_minor])
+
# Determine floating-point type for powerpc*-*-linux*.
# Single-precision-only FPRs are not a supported configuration for
# this target, so are not allowed for in this test.
@@ -340,6 +359,20 @@ ppc_fp_type=hard
EOF
eval `${CC-cc} -E conftest.c | grep ppc_fp_type=`
rm -f conftest.c
+# glibc 2.19 and later provide all the soft-fp functions, with proper
+# interactions with <fenv.h> exception and rounding mode handling, so
+# make libgcc's versions into compat symbols if a recent enough glibc
+# version is being used.
+ppc_fp_compat=
+case ${ppc_fp_type} in
+soft|e500v1|e500v2)
+ if test $glibc_version_major -gt 2 \
+ || ( test $glibc_version_major -eq 2 \
+ && test $glibc_version_minor -ge 19 ); then
+ ppc_fp_compat="t-softfp-compat"
+ fi
+ ;;
+esac
;;
esac