]> git.itanic.dy.fi Git - linux-stable/blob - scripts/Makefile.debug
Makefile.debug: set -g unconditional on CONFIG_DEBUG_INFO_SPLIT
[linux-stable] / scripts / Makefile.debug
1 DEBUG_CFLAGS    := -g
2
3 ifdef CONFIG_DEBUG_INFO_SPLIT
4 DEBUG_CFLAGS    += -gsplit-dwarf
5 endif
6
7 ifndef CONFIG_AS_IS_LLVM
8 KBUILD_AFLAGS   += -Wa,-gdwarf-2
9 endif
10
11 ifndef CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
12 dwarf-version-$(CONFIG_DEBUG_INFO_DWARF4) := 4
13 dwarf-version-$(CONFIG_DEBUG_INFO_DWARF5) := 5
14 DEBUG_CFLAGS    += -gdwarf-$(dwarf-version-y)
15 endif
16
17 ifdef CONFIG_DEBUG_INFO_REDUCED
18 DEBUG_CFLAGS    += -fno-var-tracking
19 ifdef CONFIG_CC_IS_GCC
20 DEBUG_CFLAGS    += -femit-struct-debug-baseonly
21 endif
22 endif
23
24 ifdef CONFIG_DEBUG_INFO_COMPRESSED
25 DEBUG_CFLAGS    += -gz=zlib
26 KBUILD_AFLAGS   += -gz=zlib
27 KBUILD_LDFLAGS  += --compress-debug-sections=zlib
28 endif
29
30 KBUILD_CFLAGS += $(DEBUG_CFLAGS)
31 export DEBUG_CFLAGS