]> git.itanic.dy.fi Git - linux-stable/blob - scripts/Makefile.debug
Makefile.debug: re-enable debug info for .S files
[linux-stable] / scripts / Makefile.debug
1 DEBUG_CFLAGS    :=
2 debug-flags-y   := -g
3
4 ifdef CONFIG_DEBUG_INFO_SPLIT
5 DEBUG_CFLAGS    += -gsplit-dwarf
6 endif
7
8 debug-flags-$(CONFIG_DEBUG_INFO_DWARF4) += -gdwarf-4
9 debug-flags-$(CONFIG_DEBUG_INFO_DWARF5) += -gdwarf-5
10 ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_AS_IS_GNU),yy)
11 # Clang does not pass -g or -gdwarf-* option down to GAS.
12 # Add -Wa, prefix to explicitly specify the flags.
13 KBUILD_AFLAGS   += $(addprefix -Wa$(comma), $(debug-flags-y))
14 endif
15 DEBUG_CFLAGS    += $(debug-flags-y)
16 KBUILD_AFLAGS   += $(debug-flags-y)
17
18 ifdef CONFIG_DEBUG_INFO_REDUCED
19 DEBUG_CFLAGS    += -fno-var-tracking
20 ifdef CONFIG_CC_IS_GCC
21 DEBUG_CFLAGS    += -femit-struct-debug-baseonly
22 endif
23 endif
24
25 ifdef CONFIG_DEBUG_INFO_COMPRESSED
26 DEBUG_CFLAGS    += -gz=zlib
27 KBUILD_AFLAGS   += -gz=zlib
28 KBUILD_LDFLAGS  += --compress-debug-sections=zlib
29 endif
30
31 KBUILD_CFLAGS   += $(DEBUG_CFLAGS)
32 export DEBUG_CFLAGS