diff options
-rw-r--r-- | Makefile | 13 | ||||
-rw-r--r-- | scripts/Makefile.build | 2 |
2 files changed, 9 insertions, 6 deletions
@@ -732,25 +732,28 @@ KBUILD_CFLAGS += -fomit-frame-pointer | |||
732 | endif | 732 | endif |
733 | endif | 733 | endif |
734 | 734 | ||
735 | KBUILD_CFLAGS += $(call cc-option, -fno-var-tracking-assignments) | 735 | DEBUG_CFLAGS := $(call cc-option, -fno-var-tracking-assignments) |
736 | 736 | ||
737 | ifdef CONFIG_DEBUG_INFO | 737 | ifdef CONFIG_DEBUG_INFO |
738 | ifdef CONFIG_DEBUG_INFO_SPLIT | 738 | ifdef CONFIG_DEBUG_INFO_SPLIT |
739 | KBUILD_CFLAGS += $(call cc-option, -gsplit-dwarf, -g) | 739 | DEBUG_CFLAGS += $(call cc-option, -gsplit-dwarf, -g) |
740 | else | 740 | else |
741 | KBUILD_CFLAGS += -g | 741 | DEBUG_CFLAGS += -g |
742 | endif | 742 | endif |
743 | KBUILD_AFLAGS += -Wa,-gdwarf-2 | 743 | KBUILD_AFLAGS += -Wa,-gdwarf-2 |
744 | endif | 744 | endif |
745 | ifdef CONFIG_DEBUG_INFO_DWARF4 | 745 | ifdef CONFIG_DEBUG_INFO_DWARF4 |
746 | KBUILD_CFLAGS += $(call cc-option, -gdwarf-4,) | 746 | DEBUG_CFLAGS += $(call cc-option, -gdwarf-4,) |
747 | endif | 747 | endif |
748 | 748 | ||
749 | ifdef CONFIG_DEBUG_INFO_REDUCED | 749 | ifdef CONFIG_DEBUG_INFO_REDUCED |
750 | KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) \ | 750 | DEBUG_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) \ |
751 | $(call cc-option,-fno-var-tracking) | 751 | $(call cc-option,-fno-var-tracking) |
752 | endif | 752 | endif |
753 | 753 | ||
754 | KBUILD_CFLAGS += $(DEBUG_CFLAGS) | ||
755 | export DEBUG_CFLAGS | ||
756 | |||
754 | ifdef CONFIG_FUNCTION_TRACER | 757 | ifdef CONFIG_FUNCTION_TRACER |
755 | ifdef CONFIG_FTRACE_MCOUNT_RECORD | 758 | ifdef CONFIG_FTRACE_MCOUNT_RECORD |
756 | # gcc 5 supports generating the mcount tables directly | 759 | # gcc 5 supports generating the mcount tables directly |
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index f8e2794107ed..0a9d849d0fab 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -104,7 +104,7 @@ modkern_cflags = \ | |||
104 | quiet_modtag = $(if $(part-of-module),[M], ) | 104 | quiet_modtag = $(if $(part-of-module),[M], ) |
105 | 105 | ||
106 | quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ | 106 | quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ |
107 | cmd_cc_s_c = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -S -o $@ $< | 107 | cmd_cc_s_c = $(CC) $(filter-out $(DEBUG_CFLAGS), $(c_flags)) $(DISABLE_LTO) -fverbose-asm -S -o $@ $< |
108 | 108 | ||
109 | $(obj)/%.s: $(src)/%.c FORCE | 109 | $(obj)/%.s: $(src)/%.c FORCE |
110 | $(call if_changed_dep,cc_s_c) | 110 | $(call if_changed_dep,cc_s_c) |