This is the mail archive of the
mailing list for the GCC project.
Re: [patch, libgfortran, configure] Cross-compile support for libgfortran
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Steve Ellcey <sellcey at mips dot com>
- Cc: Marcus Shawcroft <marcus dot shawcroft at gmail dot com>, "burnus at net-b dot de" <burnus at net-b dot de>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Tue, 24 Sep 2013 15:33:25 +0100
- Subject: Re: [patch, libgfortran, configure] Cross-compile support for libgfortran
- Authentication-results: sourceware.org; auth=none
- References: <9537bcb6-1a09-4bb8-adec-3932a1bfa333 at BAMAIL02 dot ba dot imgtec dot org> <CAFqB+PwYPNEk2Q1ySBAuAcnrJiqOmAt36r_7Yr9Cp2o4u2ZzHA at mail dot gmail dot com> <1379958199 dot 5770 dot 481 dot camel at ubuntu-sellcey>
On 23/09/13 18:43, Steve Ellcey wrote:
> On Mon, 2013-09-23 at 16:26 +0100, Marcus Shawcroft wrote:
>> On 4 June 2013 20:49, Steve Ellcey <email@example.com> wrote:
>>> This patch allows me to build libgfortran for a cross-compiling toolchain
>>> using newlib. Currently the checks done by AC_CHECK_FUNCS_ONCE fail with
>>> my toolchain because the compile/link fails due to the configure script not
>>> using the needed linker script in the link command. The check for with_newlib
>>> is how libjava deals with the problem and it fixes my build problems.
>>> My only concern is defining HAVE_STRTOLD, strtold exists in my newlib but
>>> I am not sure if that is true for all newlib builds. I didn't see any
>>> flags that I could easily use to check for long double support in the
>>> libgfortran configure.ac, but it seems to assume that the type exists.
>>> OK to checkin?
>> This patch breaks systems where long double is wider than double. The
>> newlib implementation provides strtold for systems where double is as
>> wide as long double but not on systems where long double is wider.
>> I don;t see any issues with AC_CHECK_FUNC_ONCE when cross configuring
>> aarch64 toolchains but I would have thought that fixing the link test
>> issue you encountered would be preferable to hard coding assumptions
>> in the configure script?
> AC_CHECK_FUNC_ONCE may work for aarch64 but I don't think there is
> anyway to make it work generally for all platforms. In the libjava
> configure.ac file is the comments:
I think it would be preferable to check whether link tests do something
sane and only fall back to hard coding choices when that is not the
case. As you've currently written things we do it the other way around.
Historically that's caused problems as newlib has evolved.