This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] Fix Fortran configure for aarch64
- From: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- To: Steve Ellcey <sellcey at mips dot com>
- Cc: Tobias Burnus <burnus at net-b dot de>, Richard dot Earnshaw at arm dot com, Marcus dot Shawcroft at arm dot com, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 15 Nov 2013 18:41:29 +0100
- Subject: Re: [patch, fortran] Fix Fortran configure for aarch64
- Authentication-results: sourceware.org; auth=none
- References: <cd4d44a7-f57d-40f6-bf28-83cc4586562a at BAMAIL02 dot ba dot imgtec dot org>
Hi Steve,
It certainly looks good to me and if it works on the intended targets,
it cannot be bad! OK for trunk.
Thanks for the patch
Paul
On 15 November 2013 18:33, Steve Ellcey <sellcey@mips.com> wrote:
>
> A while back I checked in a Fortran configure patch that allowed me to build
> Fortran for the mips-mti-elf target. I used the same mechanism (checking
> with_newlib) that libstdc++ and libjava use. This change broke the aarch64
> Fortran build because that platform's newlib does not have strtold. I would
> like to change configure to not define HAVE_STRTOLD. I could just remove that
> define but instead I would again like to use the same code that the libstdc++
> uses, by checking long_double_math_on_this_cpu. This variable is actually
> never set, and because of this HAVE_STRTOLD is never set but that allows us to
> build Fortran on mips and aarch64.
>
> Mips would not use strtold even if HAVE_STRTOLD was defined because mips does
> not define REAL*10 and the REAL*16 code checks GFC_REAL_16_IS_FLOAT128
> (set for mips) before checking for HAVE_STRTOLD.
>
> Marcus Shawcroft said it works for him on aarch64 and I tested it on mips,
> OK for checkin?
>
> Steve Ellcey
> sellcey@mips.com
>
>
> 2013-11-15 Steve Ellcey <sellcey@mips.com>
>
> * configure.ac: Do not define HAVE_STRTOLD.
> * configure: Regenerate.
>
>
>
> diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
> index 6417373..6acc0f2 100644
> --- a/libgfortran/configure.ac
> +++ b/libgfortran/configure.ac
> @@ -267,12 +267,18 @@ if test "x${with_newlib}" = "xyes"; then
> # link executables.
> AC_DEFINE(HAVE_MKSTEMP, 1, [Define if you have mkstemp.])
> AC_DEFINE(HAVE_STRTOF, 1, [Define if you have strtof.])
> - AC_DEFINE(HAVE_STRTOLD, 1, [Define if you have strtold.])
> AC_DEFINE(HAVE_SNPRINTF, 1, [Define if you have snprintf.])
> AC_DEFINE(HAVE_STRCASESTR, 1, [Define if you have strcasestr.])
> AC_DEFINE(HAVE_VSNPRINTF, 1, [Define if you have vsnprintf.])
> AC_DEFINE(HAVE_LOCALTIME_R, 1, [Define if you have localtime_r.])
> AC_DEFINE(HAVE_GMTIME_R, 1, [Define if you have gmtime_r.])
> +
> + # At some point, we should differentiate between architectures
> + # like x86, which have long double versions, and alpha/powerpc/etc.,
> + # which don't. For the time being, punt.
> + if test x"long_double_math_on_this_cpu" = x"yes"; then
> + AC_DEFINE(HAVE_STRTOLD, 1, [Define if you have strtold.])
> + fi
> else
> AC_CHECK_FUNCS_ONCE(getrusage times mkstemp strtof strtold snprintf \
> ftruncate chsize chdir getlogin gethostname kill link symlink sleep ttyname \
>
--
The knack of flying is learning how to throw yourself at the ground and miss.
--Hitchhikers Guide to the Galaxy