From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755348AbbDIMom (ORCPT ); Thu, 9 Apr 2015 08:44:42 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:21727 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755145AbbDIMoj (ORCPT ); Thu, 9 Apr 2015 08:44:39 -0400 X-AuditID: cbfec7f5-b7f1e6d00000617c-68-5526738853fb Message-id: <55267431.7030304@samsung.com> Date: Thu, 09 Apr 2015 15:44:33 +0300 From: Andrey Ryabinin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-version: 1.0 To: Paul Bolle Cc: Andrew Morton , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kasan: Makefile: shut up warnings if CONFIG_COMPILE_TEST=y References: <20150407160213.8f66c90ca812c30f362dd543@linux-foundation.org> <1428507505-4015-1-git-send-email-a.ryabinin@samsung.com> <1428577598.14000.31.camel@x220> In-reply-to: <1428577598.14000.31.camel@x220> Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHLMWRmVeSWpSXmKPExsVy+t/xy7odxWqhBl9/8VvMWb+GzeLPrh1M Fpd3zWGzaNl3gcli0a0zzA6sHidm/GbxOLPgCLvHxu1PmDw+b5ILYInisklJzcksSy3St0vg yji6ZitzwVbRijv7nrI0MD4T6GLk5JAQMJF4sPImI4QtJnHh3nq2LkYuDiGBpYwSmw+uZ4Rw mpkkzp1/zQJSxSugJXHszDpmEJtFQFVi4fF/bCA2m4CexL9Z24FsDg5RgQiJ25c5IcoFJX5M vgfWKiKgLNG6+R47yExmoPUSOzZOA5sjLOAv8XbtBiaIZSsZJdb9+QE2lFNAV2JW504WkKHM AuoSU6bkgoSZBeQlNq95yzyBUWAWkh2zEKpmIalawMi8ilE0tTS5oDgpPddIrzgxt7g0L10v OT93EyMkjL/uYFx6zOoQowAHoxIP7w8WtVAh1sSy4srcQ4wSHMxKIrydwCgQ4k1JrKxKLcqP LyrNSS0+xMjEwSnVwGhVvu28jufmA8p5r9hzNs5R7hJXm2Z3zdSw9Yrh07f3+SQvLU/f9+2s 45Ojoeu2m7n27mM3Dg52F319LEF52qI9tdyVfPXqa7U//zC/aZb3tHByaoqZ/JOfpwUWH1CY 4n3NPzt+ev7+o9U+DhU2U6sNdh44eOqT97MjzZ0//aettS+7n3TzRJ8SS3FGoqEWc1FxIgBQ OXTCQQIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/09/2015 02:06 PM, Paul Bolle wrote: > On Wed, 2015-04-08 at 18:38 +0300, Andrey Ryabinin wrote: >> It might be annoying to constantly see this: >> >> scripts/Makefile.kasan:16: Cannot use CONFIG_KASAN: -fsanitize=kernel-address is not supported by compiler >> >> while performing allmodconfig/allyesconfig build tests. > > That warning might be seen - once per build - because allmodconfig and > allyesconfig enable both CONFIG_KASAN and CONFIG_COMPILE_TEST, right? > It might be seen once per build because all*config enables CONFIG_KASAN. There was no dependency on CONFIG_COMPILE_TEST before this patch. >> Disable this warning if CONFIG_COMPILE_TEST=y. > > Do we expect that some people want to enable both KASAN and COMPILE_TEST > manually (ie, not as a result of allmodconfig or allyesconfig)? If so, > those people might now be in for some head-scratching if their compiler > lacks what's apparently needed to run kasan. > I think this shouldn't be a problem. CONFIG_COMPILE_TEST used for building drivers that cannot be loaded on platform used for compiling these drivers. So it's unlikely that such kernel will be used for runtime testing. >> Signed-off-by: Andrey Ryabinin >> --- >> scripts/Makefile.kasan | 8 ++++++-- >> 1 file changed, 6 insertions(+), 2 deletions(-) >> >> diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan >> index 631619b..3f874d2 100644 >> --- a/scripts/Makefile.kasan >> +++ b/scripts/Makefile.kasan >> @@ -13,12 +13,16 @@ CFLAGS_KASAN := $(call cc-option, -fsanitize=kernel-address \ >> --param asan-instrumentation-with-call-threshold=$(call_threshold)) >> >> ifeq ($(call cc-option, $(CFLAGS_KASAN_MINIMAL) -Werror),) >> + ifneq ($(CONFIG_COMPILE_TEST),y) >> $(warning Cannot use CONFIG_KASAN: \ >> -fsanitize=kernel-address is not supported by compiler) >> + endif >> else >> ifeq ($(CFLAGS_KASAN),) >> - $(warning CONFIG_KASAN: compiler does not support all options.\ >> - Trying minimal configuration) >> + ifneq ($(CONFIG_COMPILE_TEST),y) >> + $(warning CONFIG_KASAN: compiler does not support all options.\ >> + Trying minimal configuration) > > (Side note: in this case the compiler supports that minimal > configuration, doesn't it? So shouldn't the second warning end in > Running with minimal configuration) > > or something to that effect?) > It should and it does. CFLAGS_KASAN reassigned to minimal set of options below. >> + endif >> CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL) >> endif >> endif > > Thanks, > > > Paul Bolle > >