* [PATCH] kasan: Makefile: shut up warnings if CONFIG_COMPILE_TEST=y [not found] <20150407160213.8f66c90ca812c30f362dd543@linux-foundation.org> @ 2015-04-08 15:38 ` Andrey Ryabinin 2015-04-09 11:06 ` Paul Bolle 0 siblings, 1 reply; 4+ messages in thread From: Andrey Ryabinin @ 2015-04-08 15:38 UTC (permalink / raw) To: Andrew Morton; +Cc: Michal Marek, linux-kbuild, linux-kernel, Andrey Ryabinin 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. Disable this warning if CONFIG_COMPILE_TEST=y. Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com> --- 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) + endif CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL) endif endif -- 2.3.5 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] kasan: Makefile: shut up warnings if CONFIG_COMPILE_TEST=y 2015-04-08 15:38 ` [PATCH] kasan: Makefile: shut up warnings if CONFIG_COMPILE_TEST=y Andrey Ryabinin @ 2015-04-09 11:06 ` Paul Bolle 2015-04-09 12:44 ` Andrey Ryabinin 0 siblings, 1 reply; 4+ messages in thread From: Paul Bolle @ 2015-04-09 11:06 UTC (permalink / raw) To: Andrey Ryabinin; +Cc: Andrew Morton, Michal Marek, linux-kbuild, linux-kernel 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? > 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. > Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com> > --- > 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?) > + endif > CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL) > endif > endif Thanks, Paul Bolle ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kasan: Makefile: shut up warnings if CONFIG_COMPILE_TEST=y 2015-04-09 11:06 ` Paul Bolle @ 2015-04-09 12:44 ` Andrey Ryabinin 2015-04-09 16:01 ` Paul Bolle 0 siblings, 1 reply; 4+ messages in thread From: Andrey Ryabinin @ 2015-04-09 12:44 UTC (permalink / raw) To: Paul Bolle; +Cc: Andrew Morton, Michal Marek, linux-kbuild, linux-kernel 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 <a.ryabinin@samsung.com> >> --- >> 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 > > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kasan: Makefile: shut up warnings if CONFIG_COMPILE_TEST=y 2015-04-09 12:44 ` Andrey Ryabinin @ 2015-04-09 16:01 ` Paul Bolle 0 siblings, 0 replies; 4+ messages in thread From: Paul Bolle @ 2015-04-09 16:01 UTC (permalink / raw) To: Andrey Ryabinin; +Cc: Andrew Morton, Michal Marek, linux-kbuild, linux-kernel On Thu, 2015-04-09 at 15:44 +0300, Andrey Ryabinin wrote: > 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. Yes, of course. > >> 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. It would be nice if there would at least be a comment explaining what's being done here (ie, assuming that if CONFIG_COMPILE_TEST equals 'y' we're doing a allmodconfig or an allyesconfig and that people using either of those make targets don't care whether their compiler supports kasan). Because I'd be surprised if people figure that out by looking at this Makefile. > >> Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com> > >> --- > >> 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. Which makes "Trying" ambiguous, but anyway, it's just a side note. > >> + endif > >> CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL) > >> endif > >> endif Thanks, Paul Bolle ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-04-09 16:01 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20150407160213.8f66c90ca812c30f362dd543@linux-foundation.org> 2015-04-08 15:38 ` [PATCH] kasan: Makefile: shut up warnings if CONFIG_COMPILE_TEST=y Andrey Ryabinin 2015-04-09 11:06 ` Paul Bolle 2015-04-09 12:44 ` Andrey Ryabinin 2015-04-09 16:01 ` Paul Bolle
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).