Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4864256pxb; Sun, 7 Nov 2021 00:44:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrZuPXmHKfuJP7+2YGRu23VwNgCxra5mFVWf2DpuEwNlHXp7qnJ/nyhxaxQ8n190E8+YJr X-Received: by 2002:a05:6402:40d0:: with SMTP id z16mr66392709edb.340.1636271076055; Sun, 07 Nov 2021 00:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636271076; cv=none; d=google.com; s=arc-20160816; b=Pyi58GYDo2tprzMvQfgEnHB19OG2oUZln7kDpnbrpOPZHdnnm18pT2A8kcTXvZAq3P RVmLd174nBYIhy8RQ4mUCMfd83XXhQOwHHyvtmAQMo46MRN+pp2QqrXkibAK2/Lu6ld+ yRMdSg5hOdouZEcvLXV2KPAhP02DGK63N0CjF2dMiNUPIhe6ZxsqCIJACmKW7saLAvaM tBvG7gWKdkeBAtMEYSt5WgtgrV7RRA4dnexG6lStdK+Tj/hfSV1bIGCS7duj8hVouZbX 3HaNEaPcKj0Dvs7/Vk/IzMCACBu1NkpGHCXxqrtVJaj7Z4rYdh3sYsXrH7GEvmS1kdSj r0Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kUyhfNj4vwK08q2Vyjd378NFm4xb1Szg7ygCKFnzz3o=; b=K4JaCSyThzrlXYp/IEmwaackKWKuHRGcIZQdvlnoA4VEVgxz/J5x1uS7b8ilFcx0cp Rs+9aZgkt20yiJLL9dgYwh4ZGBFlk1D1cJWfkR3lZ9R+Vnk/9pnFGznwCIGePxE9C56K D72FGt+I6A1bhOlh4IWjIayML+sr8fRD+MGwfPdclaIZmjJ1t4ugDwbfCMYe1r6sVCEs B1JEvcPsSaBHPFJPds1lfi21bTTm1Vtd2T2OIJJZKTWQUVXkBHiGEEZjsRPSaQ1DVdON 2kg2W+uIYWWmY7OpeOJanNpyr9d70e3PhrY+0OntUue2NKpQ2VukrVtV5F1/FIHmBt4m +05w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S8vVadJn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb24si9325301ejc.378.2021.11.07.00.44.11; Sun, 07 Nov 2021 00:44:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S8vVadJn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234919AbhKFTaa (ORCPT + 99 others); Sat, 6 Nov 2021 15:30:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:45234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232626AbhKFTa3 (ORCPT ); Sat, 6 Nov 2021 15:30:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F06E761051; Sat, 6 Nov 2021 19:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636226868; bh=xHbbKopAcL+R4RbxmrJnPw4G1mPEiz0DA4CRQStuUXo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S8vVadJnlRaB2/11cvIr3Vq8S6vx4LmgODuJo0nLPkyDGzUu+JyHyzTlrLsSLkC00 I8VTOr6rSml6sxip3DI+NNyr7wV4szmP4vTfCpLU8pY7ZugotN+Kd8chVZHqfvOn+5 GL2HRCPJq3CGrHCXeOUIvVH0p3YHf5lzqkqQIT0In94FwsC53ThAfHz/Qm92jwzPiD l8KdA590CPVang5r4OaYRpx2Sqd0XHTXODfPwX03/jaHe13TSFXXlcMF5tQXpfydMu aY+WTeZvILFLdHn6rsDDzuSQl640v0l9wH3C43K6UmC9ttCxEevnR2rTr5+HYYrfXd FuvwpiJEmdhYg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 96D47410A1; Sat, 6 Nov 2021 16:27:45 -0300 (-03) Date: Sat, 6 Nov 2021 16:27:45 -0300 From: Arnaldo Carvalho de Melo To: John Garry Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, masahiroy@kernel.org, Laura Abbott , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, irogers@google.com Subject: Re: [PATCH] perf tools: Enable warnings through HOSTCFLAGS Message-ID: References: <1635525041-151876-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1635525041-151876-1-git-send-email-john.garry@huawei.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sat, Oct 30, 2021 at 12:30:41AM +0800, John Garry escreveu: > The tools build system uses KBUILD_HOSTCFLAGS symbol for obvious purposes. > > However this is not set for anything under tools/ > > As such, host tools apps built have no compiler warnings enabled. > > Declare HOSTCFLAGS for perf tools build, and also use that symbol in > declaration of host_c_flags. HOSTCFLAGS comes from EXTRA_WARNINGS, which > is independent of target platform/arch warning flags. > > Suggested-by: Jiri Olsa > Signed-off-by: John Garry > -- > Using HOSTCFLAGS, as opposed to KBUILD_HOSTCFLAGS, is going opposite > direction to commit 96f14fe738b6 ("kbuild: Rename HOSTCFLAGS to > KBUILD_HOSTCFLAGS"), so would like further opinion from Laura and > Masahiro. Laura's redhat e-mail bouncedm updated it to her kernel.org one, Laura, Masahiro, would you please comment? Jiri? - Arnaldo > diff --git a/tools/build/Build.include b/tools/build/Build.include > index 2cf3b1bde86e..c2a95ab47379 100644 > --- a/tools/build/Build.include > +++ b/tools/build/Build.include > @@ -99,7 +99,7 @@ cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXX > ### > ## HOSTCC C flags > > -host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(KBUILD_HOSTCFLAGS) -D"BUILD_STR(s)=\#s" $(HOSTCFLAGS_$(basetarget).o) $(HOSTCFLAGS_$(obj)) > +host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(HOSTCFLAGS) -D"BUILD_STR(s)=\#s" $(HOSTCFLAGS_$(basetarget).o) $(HOSTCFLAGS_$(obj)) > > # output directory for tests below > TMPOUT = .tmp_$$$$ > diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config > index 4a9baed28f2e..9b95ba09657f 100644 > --- a/tools/perf/Makefile.config > +++ b/tools/perf/Makefile.config > @@ -17,6 +17,7 @@ detected = $(shell echo "$(1)=y" >> $(OUTPUT).config-detected) > detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected) > > CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS)) > +HOSTCFLAGS := $(filter-out -Wnested-externs,$(EXTRA_WARNINGS)) > > include $(srctree)/tools/scripts/Makefile.arch > > @@ -211,6 +212,7 @@ endif > ifneq ($(WERROR),0) > CORE_CFLAGS += -Werror > CXXFLAGS += -Werror > + HOSTCFLAGS += -Werror > endif > > ifndef DEBUG > @@ -292,6 +294,9 @@ CXXFLAGS += -ggdb3 > CXXFLAGS += -funwind-tables > CXXFLAGS += -Wno-strict-aliasing > > +HOSTCFLAGS += -Wall > +HOSTCFLAGS += -Wextra > + > # Enforce a non-executable stack, as we may regress (again) in the future by > # adding assembler files missing the .GNU-stack linker note. > LDFLAGS += -Wl,-z,noexecstack > diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf > index a3966f290297..8ca656aa8b06 100644 > --- a/tools/perf/Makefile.perf > +++ b/tools/perf/Makefile.perf > @@ -226,7 +226,7 @@ else > endif > > export srctree OUTPUT RM CC CXX LD AR CFLAGS CXXFLAGS V BISON FLEX AWK > -export HOSTCC HOSTLD HOSTAR > +export HOSTCC HOSTLD HOSTAR HOSTCFLAGS > > include $(srctree)/tools/build/Makefile.include > > -- > 2.17.1 -- - Arnaldo