From patchwork Mon Dec 17 19:20:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 206975 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 3A0912C008E for ; Tue, 18 Dec 2012 06:20:38 +1100 (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=1356376839; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=BUZrYqmjCLkY7nnzIv+/lfbolug=; b=DGSYBqx6vPmaolAfqVtwW21LW0hJXG21BB4IS9T/19iUdLZYtLxDnFka1gXv7+ /0fI1u9hA50yWRVOuYdBve/bflDQrmiF0zBRqMbu905icXvETqLT/K5BSel0ZBT8 vDV6zO4BaHv71HDazdVpk+gczkLgIdPObHe0weZBF4Mvg= 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:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=az1fUZBXuoZnWagZJ2vwSg8bZwtLUaHq3gONekkb3gd4sFPEHDbVCbsgBl89Lh x/rzXAwvZ18056YL2cL6QG/8mF0N/mlB0WU+PparzU41y/iPEBTj5n/Zb8lfC1vz UXmYP5/lfVIFO3EFioTqwJvIlBdwhRAX4+Iu8QbozaSPg=; Received: (qmail 5023 invoked by alias); 17 Dec 2012 19:20:33 -0000 Received: (qmail 5008 invoked by uid 22791); 17 Dec 2012 19:20:32 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_CX X-Spam-Check-By: sourceware.org Received: from mail-qc0-f177.google.com (HELO mail-qc0-f177.google.com) (209.85.216.177) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 Dec 2012 19:20:25 +0000 Received: by mail-qc0-f177.google.com with SMTP id u28so4099479qcs.22 for ; Mon, 17 Dec 2012 11:20:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.196.70 with SMTP id ef6mr6709296qab.14.1355772024719; Mon, 17 Dec 2012 11:20:24 -0800 (PST) Received: by 10.49.12.210 with HTTP; Mon, 17 Dec 2012 11:20:24 -0800 (PST) In-Reply-To: <50C98471.3070102@gnu.org> References: <50C844FC.9040604@gnu.org> <50C898C0.3040205@gnu.org> <50C8C66F.1060707@gnu.org> <50C90194.9030508@gnu.org> <50C98471.3070102@gnu.org> Date: Mon, 17 Dec 2012 11:20:24 -0800 Message-ID: Subject: Re: PATCH: Remove AM_MAKEFLAGS from libsanitizer From: "H.J. Lu" To: Paolo Bonzini Cc: DJ Delorie , neroden@gcc.gnu.org, Alexandre Oliva , Ralf Wildenhues , gcc-patches@gcc.gnu.org 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 Wed, Dec 12, 2012 at 11:32 PM, Paolo Bonzini wrote: > Il 13/12/2012 00:23, H.J. Lu ha scritto: >> On Wed, Dec 12, 2012 at 3:01 PM, H.J. Lu wrote: >>> On Wed, Dec 12, 2012 at 2:13 PM, Paolo Bonzini wrote: >>>> Il 12/12/2012 19:11, H.J. Lu ha scritto: >>>>>>>>> >>>>>>>>> in RAW_CXX_TARGET_EXPORTS. There is no need to do anything. >>>>>>> >>>>>>> Nope, if you remove this you get the wrong definition of CC and CXX from >>>>>>> EXTRA_TARGET_FLAGS. Instead, you need to add RAW_CXX_FOR_TARGET to >>>>>>> AM_MAKEFLAGS and EXTRA_TARGET_FLAGS. >>>>>>> >>>>> We have set CXX and CXX_FOR_TARGET before EXTRA_TARGET_FLAGS >>>>> is used: >>>>> >>>>> RAW_CXX_TARGET_EXPORTS = \ >>>>> $(BASE_TARGET_EXPORTS) \ >>>>> CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ >>>>> CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; >>>>> export CXX; >>>>> >>>>> Shouldn't we the right CXX and CXX_FOR_TARGET? >>>> >>>> The purpose of EXTRA_TARGET_FLAGS is to forward any *_FOR_TARGET >>>> variable passed on the command line to the toplevel Makefile. >>>> >>> >>> We don't pass down RAW_CXX_FOR_TARGET from toplevel >>> Makefile. If one wants to change RAW_CXX_FOR_TARGET >>> from command line, he/she should do >>> >>> # make RAW_CXX_FOR_TARGET=xxx >>> >>> and RAW_CXX_TARGET_EXPORTS should handle it properly. > > NORMAL_TARGET_EXPORTS and RAW_CXX_TARGET_EXPORTS is (mostly) for > configure time. Makefiles do not use the environment variables, so you > need EXTRA_TARGET_FLAGS (and more generally the args argument to the > "all" macro) instead. > >> >> Also there are: >> >> # ------------------------------ >> # Special directives to GNU Make >> # ------------------------------ >> >> # Don't pass command-line variables to submakes. >> .NOEXPORT: >> MAKEOVERRIDES= >> >> in toplevel Makefile. How does >> >> # make *_FOR_TARGET=xxxx >> >> work at toplevel? > > That's what I'm trying to say: the purpose of EXTRA_TARGET_FLAGS is to > forward any *_FOR_TARGET>> variable passed on the command line to the > toplevel Makefile. > > Paolo This patch allows me to override RAW_CXX_FOR_TARGET from command-line at toplevel. diff --git a/Makefile.tpl b/Makefile.tpl index 5cdc119..c0e0106 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -574,6 +574,7 @@ CXX_FOR_TARGET_FLAG_TO_PASS = \ # really work, for C++ host programs can't depend on the current-stage # C++ target library. CXX_FOR_TARGET_FLAG_TO_PASS = \ + "RAW_CXX_FOR_TARGET=$(RAW_CXX_FOR_TARGET)" \ $(shell if echo "$(CXX_FOR_TARGET)" | grep " -funconfigured-" > /dev/null; then :; else echo '"CXX_FOR_TARGET=$(CXX_FOR_TARGET)"'; fi) @endif target-libstdc++-v3