4 ifdef CONFIG_DEBUG_INFO_SPLIT
5 DEBUG_CFLAGS += -gsplit-dwarf
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))
15 DEBUG_CFLAGS += $(debug-flags-y)
16 KBUILD_AFLAGS += $(debug-flags-y)
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
25 ifdef CONFIG_DEBUG_INFO_COMPRESSED
26 DEBUG_CFLAGS += -gz=zlib
27 KBUILD_AFLAGS += -gz=zlib
28 KBUILD_LDFLAGS += --compress-debug-sections=zlib
31 KBUILD_CFLAGS += $(DEBUG_CFLAGS)