public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marcus Shawcroft <marcus.shawcroft@gmail.com>
To: James Greenhalgh <james.greenhalgh@arm.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Marcus Shawcroft <marcus.shawcroft@arm.com>,
		Richard Earnshaw <richard.earnshaw@arm.com>,
	burnus@net-b.de, ramana.radhakrishnan@arm.com, 	sellcey@mips.com
Subject: Re: [Patch] Add to the libgfortran/newlib bodge to "detect" ftruncate support in ARM/AArch64/SH
Date: Thu, 20 Aug 2015 10:02:00 -0000	[thread overview]
Message-ID: <CAFqB+Px71mv3bqrnEJQT05yCSMDQd3v8t9Nbk0rj6FSnnUXi4Q@mail.gmail.com> (raw)
In-Reply-To: <1440059519-25600-1-git-send-email-james.greenhalgh@arm.com>

On 20 August 2015 at 09:31, James Greenhalgh <james.greenhalgh@arm.com> wrote:
>
> Hi,
>
> Steve's patch in 2013 [1] to fix the MIPS newlib/libgfortran build
> causes subtle issues for an ARM/AArch64 newlib/libgfortran build. The
> problem is that ARM/AArch64 (and SH) define a stub function for
> ftruncate, which we would previously have auto-detected, but which is not
> part of the hardwiring Steve added.
>
> Continuing the tradition of building bodge on bodge on bodge, this patch
> hardwires HAVE_FTRUNCATE on for ARM/AArch64/SH, which does fix the issue
> I was seeing.

This is the second breakage I'm aware of due to the introduction of
this hardwire code, the first being related to strtold.  My
recollection is that it is only the mips target that requires the
newlib API hardwiring. Ideally we should rely only on the
AC_CHECK_FUNCS_ONCE probe code and avoid the hardwire entirely.

Perhaps a better approach for trunk would be something along the lines of:

case "${host}--x${with_newlib}" in
mips*--xyes)
  hardwire_newlib=1;;
esac
if test "${hardwire_newlib:-0}" -eq 1; then
  ... existing AC_DEFINES hardwire code
else
  ... existing AC_CHECK_FUNCS_ONCE probe code
fi

In effect limiting the hardwire to just the target which is unable to
probe.  For backport to 4.9 and 5 I think James' more conservative
patch is probably more appropriate.

What do folks think?

Cheers
/Marcus

  reply	other threads:[~2015-08-20  9:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-20  8:32 James Greenhalgh
2015-08-20 10:02 ` Marcus Shawcroft [this message]
2015-08-21 10:49   ` James Greenhalgh
2015-08-25 14:14     ` James Greenhalgh
2015-08-25 14:48       ` FX
2015-08-28 10:07         ` James Greenhalgh
2015-08-28 15:34           ` James Greenhalgh
2015-08-30 16:03             ` Hans-Peter Nilsson
2015-09-03  9:40               ` James Greenhalgh
2015-09-03 11:31                 ` Hans-Peter Nilsson
2015-08-20 21:06 ` Steve Ellcey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFqB+Px71mv3bqrnEJQT05yCSMDQd3v8t9Nbk0rj6FSnnUXi4Q@mail.gmail.com \
    --to=marcus.shawcroft@gmail.com \
    --cc=burnus@net-b.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=james.greenhalgh@arm.com \
    --cc=marcus.shawcroft@arm.com \
    --cc=ramana.radhakrishnan@arm.com \
    --cc=richard.earnshaw@arm.com \
    --cc=sellcey@mips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).