Skip to content

Commit

Permalink
Disable the __builtin_return_address() warning globally after all
Browse files Browse the repository at this point in the history
This affectively reverts commit 377ccbb ("Makefile: Mute warning
for __builtin_return_address(>0) for tracing only") because it turns out
that it really isn't tracing only - it's all over the tree.

We already also had the warning disabled separately for mm/usercopy.c
(which this commit also removes), and it turns out that we will also
want to disable it for get_lock_parent_ip(), that is used for at least
TRACE_IRQFLAGS.  Which (when enabled) ends up being all over the tree.

Steven Rostedt had a patch that tried to limit it to just the config
options that actually triggered this, but quite frankly, the extra
complexity and abstraction just isn't worth it.  We have never actually
had a case where the warning is actually useful, so let's just disable
it globally and not worry about it.

Acked-by: Steven Rostedt <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Peter Anvin <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed Oct 12, 2016
1 parent 1573d2c commit ef6000b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ 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
Expand Down
4 changes: 0 additions & 4 deletions kernel/trace/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@

# 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
Expand Down
3 changes: 0 additions & 3 deletions mm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ KCOV_INSTRUMENT_memcontrol.o := n
KCOV_INSTRUMENT_mmzone.o := n
KCOV_INSTRUMENT_vmstat.o := n

# Since __builtin_frame_address does work as used, disable the warning.
CFLAGS_usercopy.o += $(call cc-disable-warning, frame-address)

mmu-y := nommu.o
mmu-$(CONFIG_MMU) := gup.o highmem.o memory.o mincore.o \
mlock.o mmap.o mprotect.o mremap.o msync.o rmap.o \
Expand Down

0 comments on commit ef6000b

Please sign in to comment.