Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1527568pxb; Fri, 22 Oct 2021 02:43:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4OjY8YFSN7H3M4Y7IctBTytrw7a13jrEfjCH2uzBxZikg1Gpg39edRDbi9jIHnzVnudM5 X-Received: by 2002:a17:902:d501:b0:13f:f3c0:20a1 with SMTP id b1-20020a170902d50100b0013ff3c020a1mr9596301plg.39.1634895815129; Fri, 22 Oct 2021 02:43:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634895815; cv=none; d=google.com; s=arc-20160816; b=dKPPOwLi0ZrCzlFTeRAq3BK4bJ2F8klJNeNqxN1LKL5tSvDHTOANQpW6MMpy55Ey5G NBy5uogIOIQvKLTqi4dqaldymC+IsqZPQKcKYJ9Kd+FaWHiOf36IsVzTIDvLDiTbrxV3 jN2zW6zzEhSjc11mgv2Emu7CEtFNaOYZoiGO8BGkqshmVNnwq1QTKzgV4gWaoDc/+vhn xXfyHdEUlTHPfPdIC4PWkF/g807h+cjsAQZzQSCF3NwsVl2FNlnnKPowjCUC3kHhGIOM ma5sbrLVUObKYBOgunZNIg8B8V00BJkt8v1E5UlaUExpkzo5poG1AVLPpzmNrTbopMRY 59Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=izNcEmgsduQjvl1exB6Pgy1TBXSoR3UPsOWkal0kwJM=; b=XHE3+dHqsdJox+T/4Wv0mXw1UJLOLt47SCgyIQ3VO2aQu1LDptd6VyRISIBVPqngTQ q1EWExCoqPAWKqGAswobuQdBL35lMqhRne4usTPf7k0RbTc5kfj69LOGNXWf1mCWnUef RF5Si0102Vfu2mEoWvbRoD0MQNTNsHQnANRP1eiksONtsxZmMVjMhrQOswal6JkmwnTg 1PTSj3A/S+x7qQFo9ba9yX/ptNpcSkMbQdVTuFsIPpLonbGYZfuX9fr08pJbO1IrAZeQ xP3xxPEVREanDwNpNXaV7H2KwACoKbcp/ldxJR+78zFPiD9wLjl36v/ZnEjDLh/if8QD 0TUg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s16si11865940pgi.284.2021.10.22.02.43.22; Fri, 22 Oct 2021 02:43:35 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232131AbhJVJoc (ORCPT + 99 others); Fri, 22 Oct 2021 05:44:32 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:4020 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231944AbhJVJob (ORCPT ); Fri, 22 Oct 2021 05:44:31 -0400 Received: from fraeml712-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4HbK6101Khz67mB7; Fri, 22 Oct 2021 17:38:17 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml712-chm.china.huawei.com (10.206.15.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Fri, 22 Oct 2021 11:42:12 +0200 Received: from [10.202.227.179] (10.202.227.179) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Fri, 22 Oct 2021 10:42:11 +0100 Subject: Re: [PATCH v2 2/2] perf jevents: Enable warnings through HOSTCFLAGS To: Jiri Olsa CC: , , , , , , , , , , References: <1634807805-40093-1-git-send-email-john.garry@huawei.com> <1634807805-40093-3-git-send-email-john.garry@huawei.com> From: John Garry Message-ID: <86aee893-0b6b-bce3-d1aa-3b66365592d1@huawei.com> Date: Fri, 22 Oct 2021 10:42:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.179] X-ClientProxiedBy: lhreml731-chm.china.huawei.com (10.201.108.82) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/10/2021 13:48, Jiri Olsa wrote: >> +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 7df13e74450c..118bcdc70bb4 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 >> >> diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build >> index a055dee6a46a..d5c287f069a2 100644 >> --- a/tools/perf/pmu-events/Build >> +++ b/tools/perf/pmu-events/Build >> @@ -1,7 +1,7 @@ >> hostprogs := jevents >> >> jevents-y += json.o jsmn.o jevents.o >> -HOSTCFLAGS_jevents.o = -I$(srctree)/tools/include >> +HOSTCFLAGS_jevents.o = -I$(srctree)/tools/include $(HOSTCFLAGS) > so the the host cflags are made of: > > host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(KBUILD_HOSTCFLAGS) -D"BUILD_STR(s)=\#s" $(HOSTCFLAGS_$(basetarget).o) $(HOSTCFLAGS_$(obj)) > ok, so IIRC, then the rule for building .o from .c in tools/build/Makefile.build will pick up HOSTCFLAGS through this variable, so we then don't need to explicitly mention it in the per-target rule, so can have this as before in pmu-events/Build HOSTCFLAGS_jevents.o = -I$(srctree)/tools/include right? (Indeed I guess that we can get rid of -I$(srctree)/tools/include as well) Thanks, John > can't you use KBUILD_HOSTCFLAGS? > > also perhaps we could rename KBUILD_HOSTCFLAGS to HOSTCFLAGS? > the name seems like leftover from kbuild move > > jirka > >> pmu-events-y += pmu-events.o >> JDIR = pmu-events/arch/$(SRCARCH) >> JSON = $(shell [ -d $(JDIR) ] &&