Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1325584pxb; Thu, 28 Oct 2021 01:26:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYiV9L+kn4ZU4B3TkWgATX0X7um5C718mje3U1hgmlYAwn6m8tYVhVlD69bqVv0WZ4m8nz X-Received: by 2002:a05:6402:1511:: with SMTP id f17mr4224866edw.68.1635409575052; Thu, 28 Oct 2021 01:26:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635409575; cv=none; d=google.com; s=arc-20160816; b=kl3ghrbAaI8tOQsh1wMQMAFTv1pdKLuEgVVjFaQAiLWcQDDrhu9p+Qkl7RYEh5j0/t zAq6sXGs/FH6lq/3dbrx3iEJfPHgRm+ZeLXozqt6lFYJrCWSIg9IheWN1o5cqORbkjbr ZAJyshebh06BQdF66AWwmZ+nyV4KjjteBdtpgMk1b2t7S8jkxBAtMzPbrOUvIpWlX0m6 qf1NDMKazO2spDBdxpNINpKlkC5n10gh9T9pLccoliGZ1UVnCfFPCD3EdIujoWflva3b k7u1IQF0aEVXnEh5rOPxPotcArqFAOP6Md9iZwdY3axBm762ZBopqv8c6fKP2YWIlIeC QxTw== 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=WPu7n8JWT5cDMmHXlU4x6CQiSapEOaYvuZQu6vkOcuQ=; b=VNpXj32hju/Rfhk39g3JjJPkRe2h6FcrLGSHWHsXfF0e62ycJBbjFVemknYvuFBlhw toHzfcDAmgHyTk8HofXCwiU7LlTdD4/g8ApjX4eJ5Y21j6J8SnYPX1UdRDEkotqOjZDZ 9VAV4eodbDb7bfRq5gqFobMAHtVV3xE+PqKKMnz2oLa0fybr50lCr9cVzUfLTCUvr4/P cAogQ92BSsCkyjQxdql3ITH6F07NIkmcMWhYZvySfN71NXtla44cDuRau3JDhU7nT/QX u3WuChyeQTh/zm4BpM5PR9iAb9DUgNuI+mV31fVEtlE/FTEBRUUeTVOZtPtXdfh4ITuB fCMg== 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 gt37si3766460ejc.454.2021.10.28.01.25.51; Thu, 28 Oct 2021 01:26:15 -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 S229869AbhJ1I03 (ORCPT + 99 others); Thu, 28 Oct 2021 04:26:29 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:4035 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbhJ1I03 (ORCPT ); Thu, 28 Oct 2021 04:26:29 -0400 Received: from fraeml703-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Hfz4B2whkz6H6r9; Thu, 28 Oct 2021 16:19:22 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml703-chm.china.huawei.com (10.206.15.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.15; Thu, 28 Oct 2021 10:23:59 +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; Thu, 28 Oct 2021 09:23:59 +0100 Subject: Re: [PATCH v2 2/2] perf jevents: Enable warnings through HOSTCFLAGS To: Arnaldo Carvalho de Melo , Jiri Olsa CC: "peterz@infradead.org" , "mark.rutland@arm.com" , "alexander.shishkin@linux.intel.com" , "namhyung@kernel.org" , "mingo@redhat.com" , "irogers@google.com" , "linux-perf-users@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kjain@linux.ibm.com" , "james.clark@arm.com" References: <1634807805-40093-1-git-send-email-john.garry@huawei.com> <1634807805-40093-3-git-send-email-john.garry@huawei.com> <86aee893-0b6b-bce3-d1aa-3b66365592d1@huawei.com> From: John Garry Message-ID: <32d98804-7e56-e73b-4c66-8776dbf58ddf@huawei.com> Date: Thu, 28 Oct 2021 09:23:58 +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: lhreml734-chm.china.huawei.com (10.201.108.85) 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 25/10/2021 17:20, Arnaldo Carvalho de Melo wrote: > Em Mon, Oct 25, 2021 at 01:40:44PM +0200, Jiri Olsa escreveu: >> On Fri, Oct 22, 2021 at 10:42:11AM +0100, John Garry wrote: >>> 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) >> >> hm, the -I.. should stay no? I don't see that >> it's being added soem other way >> >> jirka >> > > Probably this change from KBUILD_HOSTCFLAGS back to HOSTCFLAGS should > come with this; > > Cc: Laura Abbott > Cc: Masahiro Yamada > Fixes: 96f14fe738b69dd9 ("kbuild: Rename HOSTCFLAGS to KBUILD_HOSTCFLAGS") > > Right? Maybe, but then renaming back from KBUILD_HOSTCFLAGS -> HOSTCFLAGS seems odd as a fix Anyway, now that this original series is in perf/core, I'll send patches on top with this change, cc'ing Laura and Masahiro Thanks!