rust: add `.rustfmt.toml`
[linux-block.git] / scripts / Makefile.debug
CommitLineData
32ef9e50
ND
1DEBUG_CFLAGS :=
2debug-flags-y := -g
6947fd96
MY
3
4ifdef CONFIG_DEBUG_INFO_SPLIT
5DEBUG_CFLAGS += -gsplit-dwarf
6947fd96
MY
6endif
7
32ef9e50
ND
8debug-flags-$(CONFIG_DEBUG_INFO_DWARF4) += -gdwarf-4
9debug-flags-$(CONFIG_DEBUG_INFO_DWARF5) += -gdwarf-5
10ifeq ($(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.
13KBUILD_AFLAGS += $(addprefix -Wa$(comma), $(debug-flags-y))
6947fd96 14endif
32ef9e50
ND
15DEBUG_CFLAGS += $(debug-flags-y)
16KBUILD_AFLAGS += $(debug-flags-y)
6947fd96
MY
17
18ifdef CONFIG_DEBUG_INFO_REDUCED
19DEBUG_CFLAGS += -fno-var-tracking
20ifdef CONFIG_CC_IS_GCC
21DEBUG_CFLAGS += -femit-struct-debug-baseonly
22endif
23endif
24
25ifdef CONFIG_DEBUG_INFO_COMPRESSED
26DEBUG_CFLAGS += -gz=zlib
27KBUILD_AFLAGS += -gz=zlib
28KBUILD_LDFLAGS += --compress-debug-sections=zlib
29endif
30
32ef9e50 31KBUILD_CFLAGS += $(DEBUG_CFLAGS)
6947fd96 32export DEBUG_CFLAGS