[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160801141053.50468749@gandalf.local.home>
Date: Mon, 1 Aug 2016 14:10:53 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>,
Ingo Molnar <mingo@...hat.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: warning: calling ‘__builtin_return_address’ with a nonzero argument is unsafe
On Thu, 28 Jul 2016 22:30:43 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:
> On Thu, 28 Jul 2016 18:25:33 -0700
> Linus Torvalds <torvalds@...ux-foundation.org> wrote:
>
> > I tried something like that, but the CFLAGS games the tracing code
> > does made my thing result in
> >
> > kernel/trace/Makefile:20: *** Recursive variable 'KBUILD_CFLAGS'
> > references itself (eventually). Stop.
> >
> > but yes, if you have the magic fingers to make it work, limiting the
> > -Wno-frame-address to just the tracing code sounds like the
> > RightThing(tm).
>
> Take 2:
>
> It compiles for me, but I don't have a compiler that has that warning
> to test with. See if this works. BTW, it looks like that last comma
> before the ending parenthesis is not needed.
Linus, did you get a chance to test this? I could send a formal patch
if needed. I only have a 4.9 compiler, so I'm not seeing the warnings
others have reported.
-- Steve
>
> Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
> ---
> diff --git a/Makefile b/Makefile
> index 393b615..d384848 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -620,7 +620,6 @@ include arch/$(SRCARCH)/Makefile
>
> KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
> KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)
> -KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
>
> ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
> KBUILD_CFLAGS += -Os
> diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
> index 979e7bf..d0a1617 100644
> --- a/kernel/trace/Makefile
> +++ b/kernel/trace/Makefile
> @@ -1,4 +1,8 @@
>
> +# We are fully aware of the dangers of __builtin_return_address()
> +FRAME_CFLAGS := $(call cc-disable-warning,frame-address)
> +KBUILD_CFLAGS += $(FRAME_CFLAGS)
> +
> # Do not instrument the tracer itself:
>
> ifdef CONFIG_FUNCTION_TRACER
Powered by blists - more mailing lists