summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-19 21:00:53 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-19 21:00:53 +0000
commita3180a397ed1923a3a3655e4d0aec2f11e37327f (patch)
treecacf5acabfee467ac9b6420c71be5a7c048e6fea /libgfortran
parentc83123667a9e30e338651943b46cee4f8fa5b4a1 (diff)
PR target/78478
* config/ax_check_define.m4: New file. libgfortran/ChangeLog: PR target/78478 * acinclude.m4: Include ../config/ax_check_define.m4 * configure.ac: Check if _SOFT_FLOAT is defined. * configure.host (i?86 | x86_64): Use fpu-generic when have_soft_float is set. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244651 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog9
-rw-r--r--libgfortran/acinclude.m41
-rwxr-xr-xlibgfortran/configure37
-rw-r--r--libgfortran/configure.ac3
-rw-r--r--libgfortran/configure.host6
5 files changed, 55 insertions, 1 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 6d252be9186c..ad4f65b7fb23 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,12 @@
+2017-01-19 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/78478
+ * acinclude.m4: Include ../config/ax_check_define.m4
+ * configure.ac: Check if _SOFT_FLOAT is defined.
+ * configure.host (i?86 | x86_64): Use fpu-generic when
+ have_soft_float is set.
+ * configure: Regenerate.
+
2017-01-19 Jakub Jelinek <jakub@redhat.com>
PR target/79127
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
index 34e14071aebd..ceb80a12a180 100644
--- a/libgfortran/acinclude.m4
+++ b/libgfortran/acinclude.m4
@@ -1,6 +1,7 @@
m4_include(../config/acx.m4)
m4_include(../config/no-executables.m4)
m4_include(../config/math.m4)
+m4_include(../config/ax_check_define.m4)
dnl Check that we have a working GNU Fortran compiler
AC_DEFUN([LIBGFOR_WORKING_GFORTRAN], [
diff --git a/libgfortran/configure b/libgfortran/configure
index 20b5e6817126..81238fcb79c6 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -25822,6 +25822,43 @@ $as_echo "#define HAVE_FP_ENABLE 1" >>confdefs.h
fi
+# Check if _SOFT_FLOAT is defined
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _SOFT_FLOAT defined" >&5
+$as_echo_n "checking for _SOFT_FLOAT defined... " >&6; }
+if test "${ac_cv_defined__SOFT_FLOAT+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ #ifdef _SOFT_FLOAT
+ int ok;
+ #else
+ choke me
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_defined__SOFT_FLOAT=yes
+else
+ ac_cv_defined__SOFT_FLOAT=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_defined__SOFT_FLOAT" >&5
+$as_echo "$ac_cv_defined__SOFT_FLOAT" >&6; }
+if test $ac_cv_defined__SOFT_FLOAT != "no"; then :
+ have_soft_float=yes
+fi
+
# Runs configure.host to set up necessary host-dependent shell variables.
# We then display a message about it, and propagate them through the
# build chain.
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 66a84625e525..37b12d2998f4 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -556,6 +556,9 @@ AC_CHECK_FUNC([fpresetsticky],[have_fpresetsticky=yes AC_DEFINE([HAVE_FPRESETSTI
AC_CHECK_FUNC([fp_trap],[have_fp_trap=yes AC_DEFINE([HAVE_FP_TRAP],[1],[fp_trap is present])])
AC_CHECK_FUNC([fp_enable],[have_fp_enable=yes AC_DEFINE([HAVE_FP_ENABLE],[1],[fp_enable is present])])
+# Check if _SOFT_FLOAT is defined
+AC_CHECK_DEFINE([_SOFT_FLOAT],[have_soft_float=yes])
+
# Runs configure.host to set up necessary host-dependent shell variables.
# We then display a message about it, and propagate them through the
# build chain.
diff --git a/libgfortran/configure.host b/libgfortran/configure.host
index 0a12a32fc8a5..5824f253e2f1 100644
--- a/libgfortran/configure.host
+++ b/libgfortran/configure.host
@@ -40,7 +40,11 @@ fi
# the x86 denormal exception.
case "${host_cpu}" in
i?86 | x86_64)
- fpu_host='fpu-387'
+ if test "x${have_soft_float}" = "xyes"; then
+ fpu_host='fpu-generic'
+ else
+ fpu_host='fpu-387'
+ fi
ieee_support='yes'
;;
esac