From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122871 invoked by alias); 20 Aug 2015 09:50:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 122858 invoked by uid 89); 20 Aug 2015 09:50:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_40,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f172.google.com Received: from mail-wi0-f172.google.com (HELO mail-wi0-f172.google.com) (209.85.212.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 20 Aug 2015 09:50:50 +0000 Received: by wijp15 with SMTP id p15so11028449wij.0 for ; Thu, 20 Aug 2015 02:50:47 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.194.91.162 with SMTP id cf2mr4184638wjb.19.1440064247846; Thu, 20 Aug 2015 02:50:47 -0700 (PDT) Received: by 10.28.62.130 with HTTP; Thu, 20 Aug 2015 02:50:47 -0700 (PDT) In-Reply-To: <1440059519-25600-1-git-send-email-james.greenhalgh@arm.com> References: <1440059519-25600-1-git-send-email-james.greenhalgh@arm.com> Date: Thu, 20 Aug 2015 10:02:00 -0000 Message-ID: Subject: Re: [Patch] Add to the libgfortran/newlib bodge to "detect" ftruncate support in ARM/AArch64/SH From: Marcus Shawcroft To: James Greenhalgh Cc: "gcc-patches@gcc.gnu.org" , Marcus Shawcroft , Richard Earnshaw , burnus@net-b.de, ramana.radhakrishnan@arm.com, sellcey@mips.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg01182.txt.bz2 On 20 August 2015 at 09:31, James Greenhalgh 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