From patchwork Thu Sep 26 13:47:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Shawcroft X-Patchwork-Id: 278198 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8862B2C032E for ; Thu, 26 Sep 2013 23:47:56 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=KpkNvJCBSO5uGUpeQO/fVRxSydhALWmHAXtA1S6cEo8 E9Ra9+N0ds7KqTRzr3J4zqJbgKp500IZvXSF1EylsOy2dMmYWPJ3jjSj1J7Fb2ZQ fi3OM7HIn7WiYKatDfwu1zbtNTkgQkyZPcHpyTuF+uLajxXqGlQs0tTaurmN1a6E = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=ebVftSke6KV3QWwhxEIX1P0Yj4w=; b=vXGaAvndOt6OxO+4s nAUz7FJOGy4jPdqUwMZRB0tJFTdTP3rS7D5mzN0ZF71GTF32gD7AW56X3t93HsPn J6Ql9IJdCLdlDqTZekcvPDOWJDML3kYNXLKdviuWHJuee34XdeyBNhpdrxzyNEy3 4fsHqdnCfxKofREWOEypujH9jA= Received: (qmail 20898 invoked by alias); 26 Sep 2013 13:47:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 20881 invoked by uid 89); 26 Sep 2013 13:47:49 -0000 Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Sep 2013 13:47:49 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_05, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPAM_SUBJECT, SPF_PASS autolearn=no version=3.3.2 X-HELO: service87.mimecast.com Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 26 Sep 2013 14:47:45 +0100 Received: from [10.1.207.140] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 26 Sep 2013 14:47:43 +0100 Message-ID: <52443AFE.5050802@arm.com> Date: Thu, 26 Sep 2013 14:47:42 +0100 From: Marcus Shawcroft User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-Version: 1.0 To: burnus@net-b.de, gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org CC: sellcey@mips.com, Richard Earnshaw Subject: [PATCH] Fix libgfortran cross compile configury w.r.t newlib X-MC-Unique: 113092614474504901 This patch: http://gcc.gnu.org/ml/fortran/2013-06/msg00038.html ... breaks libgfortran configure against newlib. The solution implemented hard wires an assumption in libgfortran/configure.ac that newlib provides strtold(). This assumption is not correct, newlib only provides an implementation of strtold on systems where sizeof(long double) == sizeof(double). This manifests as a regression when trying to build a cross aarch64 bare metal toolchain with fortran enabled. The attached patch tightens the condition introduced in the earlier patch such that we continue to call AC_CHECK_FUNCS_ONCE unless we know that link tests are not possible, in which case we fall back to the existing broken assumption. I'm in two minds about whether further sticky tape of this form is the right approach or whether the original patch should be reverted until a proper fix that does not regress the tree can be found. Thoughts? 2013-09-26 Marcus Shawcroft * configure.ac (AC_CHECK_FUNCS_ONCE): Make if statement dependent on gcc_no_link. Cheers /Marcus diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index 4609eba..411ab38 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -261,7 +261,7 @@ GCC_HEADER_STDINT(gstdint.h) AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct stat.st_rdev]) # Check for library functions. -if test "x${with_newlib}" = "xyes"; then +if test "x${with_newlib}" = "xyes" -a "x${gcc_no_link}" = "xyes" ; then # We are being configured with a cross compiler. AC_REPLACE_FUNCS # may not work correctly, because the compiler may not be able to # link executables.