ublk_drv: add device parameter UBLK_PARAM_TYPE_DEVT
[linux-block.git] / scripts / Makefile.debug
CommitLineData
32ef9e50 1DEBUG_CFLAGS :=
2f7ab126
MO
2DEBUG_RUSTFLAGS :=
3
32ef9e50 4debug-flags-y := -g
6947fd96
MY
5
6ifdef CONFIG_DEBUG_INFO_SPLIT
7DEBUG_CFLAGS += -gsplit-dwarf
6947fd96
MY
8endif
9
32ef9e50
ND
10debug-flags-$(CONFIG_DEBUG_INFO_DWARF4) += -gdwarf-4
11debug-flags-$(CONFIG_DEBUG_INFO_DWARF5) += -gdwarf-5
12ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_AS_IS_GNU),yy)
13# Clang does not pass -g or -gdwarf-* option down to GAS.
14# Add -Wa, prefix to explicitly specify the flags.
15KBUILD_AFLAGS += $(addprefix -Wa$(comma), $(debug-flags-y))
6947fd96 16endif
32ef9e50
ND
17DEBUG_CFLAGS += $(debug-flags-y)
18KBUILD_AFLAGS += $(debug-flags-y)
6947fd96
MY
19
20ifdef CONFIG_DEBUG_INFO_REDUCED
21DEBUG_CFLAGS += -fno-var-tracking
2f7ab126 22DEBUG_RUSTFLAGS += -Cdebuginfo=1
6947fd96
MY
23ifdef CONFIG_CC_IS_GCC
24DEBUG_CFLAGS += -femit-struct-debug-baseonly
25endif
2f7ab126
MO
26else
27DEBUG_RUSTFLAGS += -Cdebuginfo=2
6947fd96
MY
28endif
29
9f8fe647 30ifdef CONFIG_DEBUG_INFO_COMPRESSED_ZLIB
6947fd96
MY
31DEBUG_CFLAGS += -gz=zlib
32KBUILD_AFLAGS += -gz=zlib
33KBUILD_LDFLAGS += --compress-debug-sections=zlib
9f8fe647
ND
34else ifdef CONFIG_DEBUG_INFO_COMPRESSED_ZSTD
35DEBUG_CFLAGS += -gz=zstd
36KBUILD_AFLAGS += -gz=zstd
37KBUILD_LDFLAGS += --compress-debug-sections=zstd
6947fd96
MY
38endif
39
32ef9e50 40KBUILD_CFLAGS += $(DEBUG_CFLAGS)
6947fd96 41export DEBUG_CFLAGS
2f7ab126
MO
42
43KBUILD_RUSTFLAGS += $(DEBUG_RUSTFLAGS)
44export DEBUG_RUSTFLAGS