From patchwork Thu May 31 11:50:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 162141 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 0F88DB6FFF for ; Thu, 31 May 2012 21:50:53 +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=1339069855; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Message-ID:Date:From:User-Agent:MIME-Version: To:CC:Subject:References:In-Reply-To:Content-Type: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=P73dnCCpRpF2dMZKYNxkP2EJVa4=; b=V45lPc+Y32mKIBP UDaaLiNTtCtSWmaUH3ngxw0ASg1Ywn9zQWfkfutMzzHFIIUrNj+JgXS+L+6lt4ZE 1Bb0utCgaU2dBSvz2jB1xZaHZaNDcMZFoqndFGQWg2VmLXruTgzm3J5w7u8A97Ar ADDHYpV3mfI0ZC+7rvNa4CBYPsdk= 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:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=mOcTg30vWfp3A57XEShf33DXASP4/3qX4xPfuIgxzTuRjyOjMjJQETv2rXGS5x vZiMhaL6NSKTHFZkYzw98MFMFBo3o+JUSHIr4o/XPktbg2UHVSWMlAvXVt3lhvQ6 2kW9LrqX5LUWmeUqg6OxrwOcgjuDRcvUa8jcatdgPOwbI=; Received: (qmail 19193 invoked by alias); 31 May 2012 11:50:49 -0000 Received: (qmail 19185 invoked by uid 22791); 31 May 2012 11:50:48 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, T_RP_MATCHES_RCVD, UPPERCASE_50_75 X-Spam-Check-By: sourceware.org Received: from mail-gh0-f176.google.com (HELO mail-gh0-f176.google.com) (209.85.160.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 May 2012 11:50:35 +0000 Received: by ghbz10 with SMTP id z10so781318ghb.21 for ; Thu, 31 May 2012 04:50:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:organization:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding:x-gm-message-state; bh=ZFf9y1+3Dx1Bel5bIpE57Wcxi/2pQXXYMsaSnotPGE0=; b=hGnm/8oMw/toh9y8NdasHdsyGIy11MsDctfXI7lrDJrmR54AEYRnahY8DSirsVcWLa ui0HfaJy309JNyRomxY6K1Q4VPN5qK9fHcXNm/CfQ7TiadGs84orXnq2Ps0+TkwXQ6FB kHi9LggJ5ss7RqzfPqQtp53qw9S/tMaeR88Gcd7RHyYwY9orM11zuzcWgcCoo0yYhz25 6IoBXoCbyWLR62x26aKSPgQThD/S+StOEBAKWzxocJwq8XvNsNz01XeDs4juJsjSGbgM zbaiZXMCFOR3RquyJfae3P6cAoJ1oUsE9beQFZKnLglX9jIyY2HFeQh1HSGuQ1tBXCjF bTWw== Received: by 10.236.185.167 with SMTP id u27mr1999176yhm.32.1338465035208; Thu, 31 May 2012 04:50:35 -0700 (PDT) Received: by 10.236.185.167 with SMTP id u27mr1999168yhm.32.1338465034963; Thu, 31 May 2012 04:50:34 -0700 (PDT) Received: from dnovillo-macbookpro.local (216-239-44-65.google.com [216.239.44.65]) by mx.google.com with ESMTPS id a34sm8009813yhh.0.2012.05.31.04.50.33 (version=SSLv3 cipher=OTHER); Thu, 31 May 2012 04:50:34 -0700 (PDT) Message-ID: <4FC75B08.7010705@google.com> Date: Thu, 31 May 2012 07:50:32 -0400 From: Diego Novillo User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: DJ Delorie CC: gcc-patches@gcc.gnu.org Subject: Re: Use C++ in COMPILER_FOR_BUILD if needed (issue6191056) References: <20120508224653.B528A102847@torture.tor.corp.google.com> <201205301742.q4UHgrkJ024825@greed.delorie.com> In-Reply-To: <201205301742.q4UHgrkJ024825@greed.delorie.com> X-Gm-Message-State: ALoCoQm0nv5KdKsDR/vmZOxYh09GgAxKSXFWxYrydMuMvWJhPus7Jxcf/vIiRYy4WZ9e1mmgMESCKRukWrKyajlVvbVGzbYtGObdbUuE4uvA3AAdaZ4jhnKqIPCLOfGJPSKJcARNa5I1v0Qf3knnAdG0JURvrXS3nQ== 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 On 12-05-30 13:42 , DJ Delorie wrote: > >>> BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE >>> +BUILD_CXXFLAGS = $(INTERNAL_CFLAGS) $(CXXFLAGS) -DGENERATOR_FILE > > Why are these so different? > > The rest seem OK Ah, I missed adding BUILD_CXXFLAGS to configure.ac. Thanks. OK to commit this amended patch? 2012-05-31 * configure.ac (CXX_FOR_BUILD): Define and substitute. (BUILD_CXXFLAGS): Define and substitute. * Makefile.in (BUILD_CXXFLAGS): Define. (CXX_FOR_BUILD): Define. (COMPILER_FOR_BUILD): Set to CXX_FOR_BUILD if building with C++. (LINKER_FOR_BUILD): Likewise. (BUILD_COMPILERFLAGS): Set to BUILD_CXXFLAGS if building with C++. (BUILD_LINKERFLAGS): Likewise. * configure: Regenerate. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 7b61b71..502cde8 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -728,15 +728,27 @@ DIR = ../gcc # Native compiler for the build machine and its switches. CC_FOR_BUILD = @CC_FOR_BUILD@ +CXX_FOR_BUILD = @CXX_FOR_BUILD@ BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE +BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ -DGENERATOR_FILE # Native compiler that we use. This may be C++ some day. +ifneq ($(ENABLE_BUILD_WITH_CXX),yes) COMPILER_FOR_BUILD = $(CC_FOR_BUILD) BUILD_COMPILERFLAGS = $(BUILD_CFLAGS) +else +COMPILER_FOR_BUILD = $(CXX_FOR_BUILD) +BUILD_COMPILERFLAGS = $(BUILD_CXXFLAGS) +endif # Native linker that we use. +ifneq ($(ENABLE_BUILD_WITH_CXX),yes) LINKER_FOR_BUILD = $(CC_FOR_BUILD) BUILD_LINKERFLAGS = $(BUILD_CFLAGS) +else +LINKER_FOR_BUILD = $(CXX_FOR_BUILD) +BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS) +endif # Native linker and preprocessor flags. For x-fragment overrides. BUILD_LDFLAGS=@BUILD_LDFLAGS@ diff --git a/gcc/configure.ac b/gcc/configure.ac index a3a4038..0c55952 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1848,7 +1848,9 @@ AC_SUBST(inhibit_libc) # These are the normal (build=host) settings: CC_FOR_BUILD='$(CC)' AC_SUBST(CC_FOR_BUILD) +CXX_FOR_BUILD='$(CXX)' AC_SUBST(CXX_FOR_BUILD) BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS) +BUILD_CXXFLAGS='$(ALL_CXXFLAGS)' AC_SUBST(BUILD_CXXFLAGS) BUILD_LDFLAGS='$(LDFLAGS)' AC_SUBST(BUILD_LDFLAGS) STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC)