path: root/Makefile
diff options
authorSteven Rostedt <rostedt@goodmis.org>2016-07-28 22:30:43 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-30 10:18:35 +0200
commita52031beb067ed3318c3ef226af5fa7223a7787d (patch)
tree8c33a9c00a07516c63ceceb47b69b20d4041ca00 /Makefile
parenta521e942bd9b903935d4c79993bf6d0b6d5154c7 (diff)
Makefile: Mute warning for __builtin_return_address(>0) for tracing only
commit 377ccbb483738f84400ddf5840c7dd8825716985 upstream. With the latest gcc compilers, they give a warning if __builtin_return_address() parameter is greater than 0. That is because if it is used by a function called by a top level function (or in the case of the kernel, by assembly), it can try to access stack frames outside the stack and crash the system. The tracing system uses __builtin_return_address() of up to 2! But it is well aware of the dangers that it may have, and has even added precautions to protect against it (see the thunk code in arch/x86/entry/thunk*.S) Linus originally added KBUILD_CFLAGS that would suppress the warning for the entire kernel, as simply adding KBUILD_CFLAGS to the tracing directory wouldn't work. The tracing directory plays a bit with the CFLAGS and requires a little more logic. This adds that special logic to only suppress the warning for the tracing directory. If it is used anywhere else outside of tracing, the warning will still be triggered. Link: http://lkml.kernel.org/r/20160728223043.51996267@grimm.local.home Tested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Makefile')
1 files changed, 0 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 39250a7bd6a5..734579371fad 100644
--- a/Makefile
+++ b/Makefile
@@ -617,7 +617,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,)