mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-01 08:04:22 +08:00
32ef9e5054
Alexey reported that the fraction of unknown filename instances in kallsyms grew from ~0.3% to ~10% recently; Bill and Greg tracked it down to assembler defined symbols, which regressed as a result of: commitb8a9092330
("Kbuild: do not emit debug info for assembly with LLVM_IAS=1") In that commit, I allude to restoring debug info for assembler defined symbols in a follow up patch, but it seems I forgot to do so in commita66049e2cf
("Kbuild: make DWARF version a choice") Link: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=31bf18645d98b4d3d7357353be840e320649a67d Fixes:b8a9092330
("Kbuild: do not emit debug info for assembly with LLVM_IAS=1") Reported-by: Alexey Alexandrov <aalexand@google.com> Reported-by: Bill Wendling <morbo@google.com> Reported-by: Greg Thelen <gthelen@google.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Suggested-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
33 lines
846 B
Makefile
33 lines
846 B
Makefile
DEBUG_CFLAGS :=
|
|
debug-flags-y := -g
|
|
|
|
ifdef CONFIG_DEBUG_INFO_SPLIT
|
|
DEBUG_CFLAGS += -gsplit-dwarf
|
|
endif
|
|
|
|
debug-flags-$(CONFIG_DEBUG_INFO_DWARF4) += -gdwarf-4
|
|
debug-flags-$(CONFIG_DEBUG_INFO_DWARF5) += -gdwarf-5
|
|
ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_AS_IS_GNU),yy)
|
|
# Clang does not pass -g or -gdwarf-* option down to GAS.
|
|
# Add -Wa, prefix to explicitly specify the flags.
|
|
KBUILD_AFLAGS += $(addprefix -Wa$(comma), $(debug-flags-y))
|
|
endif
|
|
DEBUG_CFLAGS += $(debug-flags-y)
|
|
KBUILD_AFLAGS += $(debug-flags-y)
|
|
|
|
ifdef CONFIG_DEBUG_INFO_REDUCED
|
|
DEBUG_CFLAGS += -fno-var-tracking
|
|
ifdef CONFIG_CC_IS_GCC
|
|
DEBUG_CFLAGS += -femit-struct-debug-baseonly
|
|
endif
|
|
endif
|
|
|
|
ifdef CONFIG_DEBUG_INFO_COMPRESSED
|
|
DEBUG_CFLAGS += -gz=zlib
|
|
KBUILD_AFLAGS += -gz=zlib
|
|
KBUILD_LDFLAGS += --compress-debug-sections=zlib
|
|
endif
|
|
|
|
KBUILD_CFLAGS += $(DEBUG_CFLAGS)
|
|
export DEBUG_CFLAGS
|