From patchwork Tue Oct 1 11:40:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Shawcroft X-Patchwork-Id: 279431 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 E32962C0086 for ; Tue, 1 Oct 2013 21:41:01 +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:references :in-reply-to:content-type; q=dns; s=default; b=pPpG6RQFR7lLhaT6c ehHrWTaQ0hX3Ra4SgYm3owVH5A0cx1k4t3Sci5HGnnfi0NZcykJV2SkJuRCQMt7o pZpVhdROSCcow3oSv1RYyzmS6EX+ParuoNcPN8Mc+0Bd5T+RJ1/Z0gdVYYC4pGe9 IUcCLbX9PSS8nlf521yL2CxLBQ= 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:references :in-reply-to:content-type; s=default; bh=buGuS2UnhPUziaVpojztK7D QT38=; b=lLeqeZS0tT0WKppkplj18uGEKmb7YNAHRqia8aCUBoF95kHlOrylj3q 7jeAPa0xeve9PO8hxg9mLNOcjShDkX3DGawgJjBy/40DdJTeR1F7Njf7rvMTwLFu xzdhKnjcBJK7+wNuP4Bvr0+FZbES9DEb7YZtobnavVT8GDRxYuIk= Received: (qmail 27047 invoked by alias); 1 Oct 2013 11:40:55 -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 27023 invoked by uid 89); 1 Oct 2013 11:40:54 -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; Tue, 01 Oct 2013 11:40:54 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham 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; Tue, 01 Oct 2013 12:40:50 +0100 Received: from [10.1.207.140] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Tue, 1 Oct 2013 12:40:47 +0100 Message-ID: <524AB4AD.6070508@arm.com> Date: Tue, 01 Oct 2013 12:40:29 +0100 From: Marcus Shawcroft User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Steve Ellcey CC: "burnus@net-b.de" , "gcc-patches@gcc.gnu.org" , "fortran@gcc.gnu.org" , Richard Earnshaw Subject: [PATCH v2] Fix libgfortran cross compile configury w.r.t newlib References: <52443AFE.5050802@arm.com> <1380298134.5988.61.camel@ubuntu-sellcey> <52497156.5010203@arm.com> In-Reply-To: <52497156.5010203@arm.com> X-MC-Unique: 113100112405000201 On 30/09/13 13:40, Marcus Shawcroft wrote: >> Well, I thought this patch would work for me, but it does not. It looks >> like gcc_no_link is set to 'no' on my target because, technically, I can >> link even if I don't use a linker script. I just can't find any >> functions. >> > In which case gating on gcc_no_link could be replaced with a test that > looks to see if we can link with the library. Perhaps looking for > exit() or some such that might reasonably be expected to be present. > > For example: > > AC_CHECK_FUNC(exit) > if test "x${with_newlib}" = "xyes" -a "x${ac_cv_func_exit}" = "xno"; then > > /Marcus > > > > Patch attached. /Marcus 2013-10-01 Marcus Shawcroft * configure.ac (AC_CHECK_FUNCS_ONCE): Add for exit() then make existing AC_CHECK_FUNCS_ONCE dependent on outcome. diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index 4609eba..ac0c02f 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -261,7 +261,8 @@ 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 +AC_CHECK_FUNC(exit) +if test "x${with_newlib}" = "xyes" -a "x${ac_cv_func_exit}" = "xno"; 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.