From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6229 invoked by alias); 21 Aug 2015 10:05:54 -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 6204 invoked by uid 89); 21 Aug 2015 10:05:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: cam-smtp0.cambridge.arm.com Received: from fw-tnat.cambridge.arm.com (HELO cam-smtp0.cambridge.arm.com) (217.140.96.140) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 21 Aug 2015 10:05:52 +0000 Received: from e107456-lin.cambridge.arm.com (e107456-lin.cambridge.arm.com [10.2.207.14]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id t7LA5lZW014301; Fri, 21 Aug 2015 11:05:47 +0100 Date: Fri, 21 Aug 2015 10:49:00 -0000 From: James Greenhalgh To: Marcus Shawcroft Cc: "gcc-patches@gcc.gnu.org" , Marcus Shawcroft , Richard Earnshaw , "burnus@net-b.de" , Ramana Radhakrishnan , "sellcey@mips.com" , fortran@gcc.gnu.org Subject: Re: [Patch] Add to the libgfortran/newlib bodge to "detect" ftruncate support in ARM/AArch64/SH Message-ID: <20150821100546.GA15842@e107456-lin.cambridge.arm.com> References: <1440059519-25600-1-git-send-email-james.greenhalgh@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg01292.txt.bz2 On Thu, Aug 20, 2015 at 10:50:47AM +0100, Marcus Shawcroft wrote: > 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? (+CC fortran@gcc.gnu.org - who I should have CCed from the start). This runs in to issues with a newlib build [1] (newlib provides a 'kill' symbol for linking, but does not provide a declaration in signal.h, so we take a -Werror=implicit-function-declaration). I think that is something that we should think about fixing in newlib, and I have a patch in the works that I'd like to start working through with the newlib community. In the mean time, I'd like to stick with this patch for trunk, GCC 5, and GCC 4.9 (with a promise that I'll revisit it once I've worked through what newlib wants to do). Is the patch I proposed OK as a "FORNOW" for trunk, and as a full-time bodge on 5, and 4.9? Thanks, James --- [1]: https://sourceware.org/ml/newlib/2015/msg00630.html