From patchwork Mon Jan 9 15:09:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 90478 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp652835obz; Mon, 9 Jan 2017 07:10:37 -0800 (PST) X-Received: by 10.84.210.233 with SMTP id a96mr193254522pli.72.1483974637306; Mon, 09 Jan 2017 07:10:37 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id j10si89075044plg.64.2017.01.09.07.10.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jan 2017 07:10:37 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-445691-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-445691-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-445691-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=O6oDYs/hMTWmxFC1l S2UYq4zhgPxWz95N2kHJK+qrIlXIhl/kKbGbhhcvNSHu8jXPHMdTfj0j2y/WG0Lv Vp4YQyXFnnDyfuVFEAq6JkTv9+lPm187i4HYpn3Y1Grx988uYthu3EDUOzU7eWxY 1qVwczKhK3BHMhhS8gOjlX1q5o= 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=lrToU/6GqmfEncyKtVngLqQ v0so=; b=YuxH/hSwL9U4CEXy77hqjyhDTROmi2fm4ivKjg9yT4R3MZGbv+gDeam mXpLO6PJkSOHlYxvD08FTH1bu5UqVYhsngnoYkzkuau+tTjCyK+FdTFq7f3KOxJA UUX2HZva4fYgBnMJqDujhQmaFqahppR0Jx/Ar7TdOWhMwLpMTNks= Received: (qmail 41505 invoked by alias); 9 Jan 2017 15:10:24 -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 41398 invoked by uid 89); 9 Jan 2017 15:10:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, SPF_PASS autolearn=ham version=3.3.2 spammy=validated, Hx-languages-length:1741, !strcmp X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Jan 2017 15:10:01 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6C969ACE4; Mon, 9 Jan 2017 15:09:59 +0000 (UTC) Subject: [PATCH] Do not error when -E provided (PR pch/78970). To: Jakub Jelinek References: <2577a04a-611e-ab46-b2c5-f39c71f02cca@suse.cz> <20170105091107.GW21933@tucnak> <20170105100947.GY21933@tucnak> <3f5a5773-959f-1c7d-5263-10ab3d1d3467@suse.cz> <20170105133038.GA21933@tucnak> <04c35189-58bc-a180-757f-f09adcdb0105@suse.cz> Cc: GCC Patches From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <6b9f8c99-0ea4-09e2-f222-97a3d28943fa@suse.cz> Date: Mon, 9 Jan 2017 16:09:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <04c35189-58bc-a180-757f-f09adcdb0105@suse.cz> X-IsSubscribed: yes Hello. As reported here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78970#c7, we should not report error when one want to pre-compile a {c,c++}-header file. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Martin >From bf226badedf38c81d09e34bde6ce0ff694e5b4fd Mon Sep 17 00:00:00 2001 From: marxin Date: Mon, 9 Jan 2017 14:20:41 +0100 Subject: [PATCH] Do not error when -E provided (PR pch/78970). gcc/ChangeLog: 2017-01-09 Martin Liska PR pch/78970 * gcc.c (driver_handle_option): Handle OPT_E and set have_E. (lookup_compiler): Do not show error message with have_E. --- gcc/gcc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/gcc.c b/gcc/gcc.c index 1d2ed99ef5f..b9cdc5d81a8 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -1931,6 +1931,9 @@ static int have_c = 0; /* Was the option -o passed. */ static int have_o = 0; +/* Were the option -E passed. */ +static int have_E = 0; + /* Pointer to output file name passed in with -o. */ static const char *output_file = 0; @@ -4067,6 +4070,10 @@ driver_handle_option (struct gcc_options *opts, validated = true; break; + case OPT_E: + have_E = true; + break; + case OPT_x: spec_lang = arg; if (!strcmp (spec_lang, "none")) @@ -8328,7 +8335,8 @@ lookup_compiler (const char *name, size_t length, const char *language) { if (name != NULL && strcmp (name, "-") == 0 && (strcmp (cp->suffix, "@c-header") == 0 - || strcmp (cp->suffix, "@c++-header") == 0)) + || strcmp (cp->suffix, "@c++-header") == 0) + && !have_E) fatal_error (input_location, "cannot use %<-%> as input filename for a " "precompiled header"); -- 2.11.0