mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
	Ingo Molnar <mingo@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: warning: calling ‘__builtin_return_address’ with a nonzero argument is unsafe
Date: Thu, 28 Jul 2016 22:30:43 -0400	[thread overview]
Message-ID: <20160728223043.51996267@grimm.local.home> (raw)
In-Reply-To: <CA+55aFy5MTAh1yJrmjsuUO88KChqegFLDNZNYi8kZatAFi2h2Q@mail.gmail.com>

On Thu, 28 Jul 2016 18:25:33 -0700
Linus Torvalds <torvalds@linux-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.

Signed-off-by: Steven Rostedt <rostedt@goodmis.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

  reply	other threads:[~2016-07-29  2:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-27 23:00 Linus Torvalds
2016-07-28  1:58 ` Steven Rostedt
2016-07-28  3:21   ` Linus Torvalds
2016-07-28  3:52     ` Steven Rostedt
2016-07-29  1:25       ` Linus Torvalds
2016-07-29  2:30         ` Steven Rostedt [this message]
2016-08-01 18:10           ` Steven Rostedt
2016-08-01 18:19             ` Linus Torvalds
2016-07-28 12:42     ` Josh Poimboeuf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160728223043.51996267@grimm.local.home \
    --to=rostedt@goodmis.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®