From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 665 invoked by alias); 20 Aug 2015 08:32:11 -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 654 invoked by uid 89); 20 Aug 2015 08:32:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS,URIBL_BLACK autolearn=no version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Aug 2015 08:32:09 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-24-GSOZv6C5TUi67IAsqyaiEw-1; Thu, 20 Aug 2015 09:32:04 +0100 Received: from e107456-lin.cambridge.arm.com ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 20 Aug 2015 09:32:04 +0100 From: James Greenhalgh To: gcc-patches@gcc.gnu.org Cc: marcus.shawcroft@arm.com, richard.earnshaw@arm.com, burnus@net-b.de, ramana.radhakrishnan@arm.com, sellcey@mips.com Subject: [Patch] Add to the libgfortran/newlib bodge to "detect" ftruncate support in ARM/AArch64/SH Date: Thu, 20 Aug 2015 08:32:00 -0000 Message-Id: <1440059519-25600-1-git-send-email-james.greenhalgh@arm.com> MIME-Version: 1.0 X-MC-Unique: GSOZv6C5TUi67IAsqyaiEw-1 Content-Type: multipart/mixed; boundary="------------2.2.0.1.gd394abb.dirty" X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg01170.txt.bz2 This is a multi-part message in MIME format. --------------2.2.0.1.gd394abb.dirty Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: quoted-printable Content-length: 1216 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. If this patch is acceptable for trunk, I'd also like to backport it to the 5.x and 4.9.x release branches. I'm not quite sure how to effectively verify this patch. I've looked at the generated config.h for aarch64-none-elf, arm-none-eabi and those come out with HAVE_FTRUNCATE defined. I wanted to check mips-none-elf, but I had no success there - the configure failed earlier when trying to link executables. I'd appreciate your help Steve to check that this patch works with your build system. Thanks, James [1]: https://gcc.gnu.org/ml/fortran/2013-09/msg00050.html --- 2015-08-14 James Greenhalgh * configure.ac: Define HAVE_FTRUNCATE for ARM/AArch64/SH newlib builds. * configure: Regenerate. --------------2.2.0.1.gd394abb.dirty Content-Type: text/x-patch; name=0001-Patch-Add-to-the-libgfortran-newlib-bodge-to-detect-.patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Patch-Add-to-the-libgfortran-newlib-bodge-to-detect-.patch" Content-length: 707 diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index 35a8b39..adafb3f 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -295,6 +295,13 @@ if test "x${with_newlib}" =3D "xyes"; then if test x"long_double_math_on_this_cpu" =3D x"yes"; then AC_DEFINE(HAVE_STRTOLD, 1, [Define if you have strtold.]) fi + + # ARM, AArch64 and SH also provide ftruncate. + case "${host}" in + arm* | aarch64* | sh*) + AC_DEFINE(HAVE_FTRUNCATE, 1, [Define if you have ftruncate.]) + ;; + esac else AC_CHECK_FUNCS_ONCE(getrusage times mkstemp strtof strtold snprintf \ ftruncate chsize chdir getlogin gethostname kill link symlink sleep tty= name \ --------------2.2.0.1.gd394abb.dirty--