From patchwork Wed Apr 18 02:38:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ollie Wild X-Patchwork-Id: 153372 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]) by ozlabs.org (Postfix) with SMTP id EF402B6F6E for ; Wed, 18 Apr 2012 12:38:42 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1335321524; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:To:Subject:Message-Id:Date: From:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=6ARDfJE nFeohHwsgCD79QR2JR2Y=; b=idKj/+a90IVuhU0MRK3OYEYOhG/XhiVNkAhO6lH 0FANAI9tDwLUrfnu9sdsyLdrbTnWll2hRm57wIRfSX2QVb+L/SNzUBa+GlqjJWwX p4DJ9qwRBfDhNR97G9fsE5v2u87X75qVukUXJ7yCsSflS8mXSOBWt/W8+/7QKvNr hEJs= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Received:Received:Received:To:Subject:Message-Id:Date:From:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=LXBKIhSk2EFq5CM8VnVmFQRAiC5o3rR8YBgVJqbNbRY4WCdS+a6IPrEgTXybIj QPfG4LrkPhIqUmbu9Rg6ICAFOdVu5MsVKr7r6WNdXzkUeTu576gotM8AKGGL6G6i vH9ggpDUX5CIn7/UnUsoOMpkkn7UI8pO0t/AmcV+/r0fo=; Received: (qmail 23424 invoked by alias); 18 Apr 2012 02:38:36 -0000 Received: (qmail 23265 invoked by uid 22791); 18 Apr 2012 02:38:35 -0000 X-SWARE-Spam-Status: No, hits=-4.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-qa0-f73.google.com (HELO mail-qa0-f73.google.com) (209.85.216.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Apr 2012 02:38:04 +0000 Received: by qafk30 with SMTP id k30so21522qaf.2 for ; Tue, 17 Apr 2012 19:38:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=to:subject:message-id:date:from:x-gm-message-state; bh=TcVIiZFal6YKmrFc0Uybiw0GhZ4mZs2YDQnG+b2woxY=; b=YFhRdm6U0XZRJom32SK2xp9EYl+IyymBlcUOM+cE8aFzzW5GFVzF0+QdB5hwj6JMDY W0RvyDwtyUPnN9FdPGkHSABpOEmIsiYAAwNh7gkAOw+ngq5RqIFNM+oH8QD9W2v0rrfv VHMwGZIsGikNxzfVTUoclUPVtOxGGP4Xd8feYF6sbzEmhigY0iiC9E9zQU4QaX1nJVXe hvozy1UUmo3lsErD2hY6ZwkUI6hjS25WNNb5bYelIgpipiqcrvX3Cgv/uyZpZjvb4Aj0 TEkVzzKe9T6QN9sxNGOVmhZXVZOy9eybDGhAEfBITq3crcehrvM+zwu0oBXblvTquLoS W1CA== Received: by 10.101.112.3 with SMTP id p3mr287302anm.0.1334716683083; Tue, 17 Apr 2012 19:38:03 -0700 (PDT) Received: by 10.101.112.3 with SMTP id p3mr287290anm.0.1334716682987; Tue, 17 Apr 2012 19:38:02 -0700 (PDT) Received: from wpzn4.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id g49si21288076yhe.6.2012.04.17.19.38.02 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 17 Apr 2012 19:38:02 -0700 (PDT) Received: from xoom.chi.corp.google.com (xoom.chi.corp.google.com [172.31.47.91]) by wpzn4.hot.corp.google.com (Postfix) with ESMTP id E6B1A1E004D; Tue, 17 Apr 2012 19:38:02 -0700 (PDT) Received: by xoom.chi.corp.google.com (Postfix, from userid 26705) id 84E2FA0EA2; Tue, 17 Apr 2012 21:38:02 -0500 (CDT) To: reply@codereview.appspotmail.com, dnovillo@google.com, gcc-patches@gcc.gnu.org Subject: [google/integration] Add -Xclang-only option (issue6047048) Message-Id: <20120418023802.84E2FA0EA2@xoom.chi.corp.google.com> Date: Tue, 17 Apr 2012 21:38:02 -0500 (CDT) From: aaw@google.com (Ollie Wild) X-Gm-Message-State: ALoCoQkajhAcNd7luZ97T/lxl3GOKpVgxL/ZWdKBXKqxtnQpa9xZrF/zo1bUvq70QuAmc5Ce+NvvvG9a0Sj61Z9grmmOfgAC3I4034SO1Rfx8i9OtXExsGlHZhc1t1mabnG4RN+L+yprmozwXbXDgyOJZgcdFnh8nlc06TaWcaOFAOvcoYZ3tTo= X-IsSubscribed: yes 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 To be submitted to the google/integration branch and merged into google/{main,gcc-4_6,gcc-4_7}. Add -Xclang-only option (which is ignored). This is used by certain drivers to pass options selectively to clang. Adding support to the gcc driver makes it easier to test GCC in the absence of these drivers. Google ref 6302116. 2012-04-17 Ollie Wild * gcc/common.opt (Xclang-only): New option. * gcc/doc/invoke.texi (Xclang-only): Document new option. * gcc/gcc.c (display_help): Print new option. (driver_handle_option): Support new option (ignoring args). --- This patch is available for review at http://codereview.appspot.com/6047048 diff --git a/gcc/common.opt b/gcc/common.opt index 4a751a9..39f0843 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -743,6 +743,9 @@ Warn when a vector operation is compiled outside the SIMD Xassembler Driver Separate +Xclang-only +Driver Joined + Xlinker Driver Separate diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index d980e9f..1b61e76 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -9560,6 +9560,11 @@ systems using the GNU linker. On some targets, such as bare-board targets without an operating system, the @option{-T} option may be required when linking to avoid references to undefined symbols. +@item -Xclang-only @var{option} +@opindex Xclang-only +Ignore @var{option}. This is used by some custom drivers to pass options +to Clang but not GCC. + @item -Xlinker @var{option} @opindex Xlinker Pass @var{option} as an option to the linker. You can use this to diff --git a/gcc/gcc.c b/gcc/gcc.c index 5f789fd..c6b48a6 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -2983,6 +2983,7 @@ display_help (void) fputs (_(" -Xassembler Pass on to the assembler\n"), stdout); fputs (_(" -Xpreprocessor Pass on to the preprocessor\n"), stdout); fputs (_(" -Xlinker Pass on to the linker\n"), stdout); + fputs (_(" -Xclang-only= Ignore \n"), stdout); fputs (_(" -save-temps Do not delete intermediate files\n"), stdout); fputs (_(" -save-temps= Do not delete intermediate files\n"), stdout); fputs (_("\ @@ -3353,6 +3354,11 @@ driver_handle_option (struct gcc_options *opts, do_save = false; break; + case OPT_Xclang_only: + /* Ignore the argument. Used by some drivers to selectively pass + arguments to clang. */ + break; + case OPT_Xlinker: add_infile (arg, "*"); do_save = false;