From patchwork Mon Aug 4 18:39:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 4673131 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B2EAB9F373 for ; Mon, 4 Aug 2014 18:47:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC9932015A for ; Mon, 4 Aug 2014 18:47:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2392820149 for ; Mon, 4 Aug 2014 18:47:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751046AbaHDSrQ (ORCPT ); Mon, 4 Aug 2014 14:47:16 -0400 Received: from mdfmta010.mxout.tch.inty.net ([91.221.169.51]:52921 "EHLO smtp.demon.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751093AbaHDSrP (ORCPT ); Mon, 4 Aug 2014 14:47:15 -0400 Received: from mdfmta010.tch.inty.net (unknown [127.0.0.1]) by mdfmta010.tch.inty.net (Postfix) with ESMTP id 4EC97400DCA; Mon, 4 Aug 2014 19:39:54 +0100 (BST) Received: from mdfmta010.tch.inty.net (unknown [127.0.0.1]) by mdfmta010.tch.inty.net (Postfix) with ESMTP id C2097400DA6; Mon, 4 Aug 2014 19:39:53 +0100 (BST) Received: from [192.168.254.10] (unknown [80.176.147.220]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mdfmta010.tch.inty.net (Postfix) with ESMTP; Mon, 4 Aug 2014 19:39:53 +0100 (BST) Message-ID: <53DFD37B.4010104@ramsay1.demon.co.uk> Date: Mon, 04 Aug 2014 19:39:55 +0100 From: Ramsay Jones User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Christopher Li CC: Sparse Mailing-list Subject: [PATCH 08/10] cgcc: use only the cc command to determine $gcc_base_dir X-MDF-HostID: 19 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Capture the c-compiler command, in the $ccom variable, in order to later invoke the compiler without extraneous command-line options. In particular, use the $ccom variable in order to cleanly invoke the compiler when setting the $gcc_base_dir variable. Signed-off-by: Ramsay Jones --- cgcc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cgcc b/cgcc index ed35e39..f330116 100755 --- a/cgcc +++ b/cgcc @@ -3,6 +3,7 @@ my $cc = $ENV{'REAL_CC'} || 'cc'; my $check = $ENV{'CHECK'} || 'sparse'; +my $ccom = $cc; my $m32 = 0; my $m64 = 0; @@ -72,7 +73,7 @@ if ($do_check) { $check .= &add_specs ('host_os_specs'); } - $gcc_base_dir = qx($cc -print-file-name=) if !$gcc_base_dir; + $gcc_base_dir = qx($ccom -print-file-name=) if !$gcc_base_dir; chomp($gcc_base_dir); # possibly remove '\n' from compiler $check .= " -gcc-base-dir " . $gcc_base_dir if $gcc_base_dir;