From patchwork Wed Oct 19 10:01:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 4738 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9D91423EF7 for ; Wed, 19 Oct 2011 10:01:19 +0000 (UTC) Received: from mail-gy0-f180.google.com (mail-gy0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 5F35FA189D9 for ; Wed, 19 Oct 2011 10:01:19 +0000 (UTC) Received: by gyf1 with SMTP id 1so2172601gyf.11 for ; Wed, 19 Oct 2011 03:01:18 -0700 (PDT) Received: by 10.223.60.73 with SMTP id o9mr10266688fah.18.1319018478327; Wed, 19 Oct 2011 03:01:18 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.1.71 with SMTP id 7cs77866lak; Wed, 19 Oct 2011 03:01:16 -0700 (PDT) Received: by 10.68.37.97 with SMTP id x1mr11542625pbj.14.1319018474651; Wed, 19 Oct 2011 03:01:14 -0700 (PDT) Received: from relay1.mentorg.com (relay1.mentorg.com. [192.94.38.131]) by mx.google.com with ESMTPS id i9si1846347pbc.70.2011.10.19.03.01.13 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 19 Oct 2011 03:01:14 -0700 (PDT) Received-SPF: neutral (google.com: 192.94.38.131 is neither permitted nor denied by best guess record for domain of Andrew_Stubbs@mentor.com) client-ip=192.94.38.131; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.94.38.131 is neither permitted nor denied by best guess record for domain of Andrew_Stubbs@mentor.com) smtp.mail=Andrew_Stubbs@mentor.com Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RGSxU-0005Ut-9O from Andrew_Stubbs@mentor.com ; Wed, 19 Oct 2011 03:01:12 -0700 Received: from [127.0.0.1] ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 19 Oct 2011 11:01:10 +0100 Message-ID: <4E9E9FE2.4030603@codesourcery.com> Date: Wed, 19 Oct 2011 11:01:06 +0100 From: Andrew Stubbs User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110923 Thunderbird/7.0 MIME-Version: 1.0 To: Andrew Stubbs CC: Richard Earnshaw , "Joseph S. Myers" , "gcc-patches@gcc.gnu.org" , "patches@linaro.org" Subject: Re: [PATCH][ARM] -m{cpu,tune,arch}=native References: <4E57B995.2010605@codesourcery.com> <4E58E76C.7010204@codesourcery.com> <4E66219E.4070706@codesourcery.com> <4E69FEC8.9070104@arm.com> <4E787025.1040402@codesourcery.com> <4E9C2CA0.4040203@arm.com> <4E9D8BCE.9080108@codesourcery.com> <4E9D8E84.80400@arm.com> <4E9D9065.7020005@mentor.com> In-Reply-To: <4E9D9065.7020005@mentor.com> X-OriginalArrivalTime: 19 Oct 2011 10:01:10.0986 (UTC) FILETIME=[0765AAA0:01CC8E46] On 18/10/11 15:42, Andrew Stubbs wrote: >> Which still jumps to not_found without closing f. > > Hmmm, I know I fixed that, I know I did! > > But I appear to have lost the change somewhere when I updated my checkout? > > I'll fix it now. Fixed and committed as attached. Apologies for the cock-up. :( Andrew 2011-10-18 Andrew Stubbs * config/arm/driver-arm.c (host_detect_local_cpu): Close the file before exiting. --- src/gcc-mainline/gcc/config/arm/driver-arm.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/gcc-mainline/gcc/config/arm/driver-arm.c b/src/gcc-mainline/gcc/config/arm/driver-arm.c index 43b6e58..9a6762b 100644 --- a/src/gcc-mainline/gcc/config/arm/driver-arm.c +++ b/src/gcc-mainline/gcc/config/arm/driver-arm.c @@ -75,7 +75,7 @@ host_detect_local_cpu (int argc, const char **argv) { const char *val = NULL; char buf[128]; - FILE *f; + FILE *f = NULL; bool arch; const struct vendor_cpu *cpu_table = NULL; @@ -134,6 +134,10 @@ not_found: unsigned int i; unsigned int opt; const char *search[] = {NULL, "arch"}; + + if (f) + fclose (f); + search[0] = argv[0]; for (opt = 0; opt < ARRAY_SIZE (search); opt++) for (i = 0; i < ARRAY_SIZE (configure_default_options); i++)