提交 32ef9e50 编写于 作者: N Nick Desaulniers 提交者: Masahiro Yamada

Makefile.debug: re-enable debug info for .S files

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:

commit b8a90923 ("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

commit a66049e2 ("Kbuild: make DWARF version a choice")

Link: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=31bf18645d98b4d3d7357353be840e320649a67d
Fixes: b8a90923 ("Kbuild: do not emit debug info for assembly with LLVM_IAS=1")
Reported-by: NAlexey Alexandrov <aalexand@google.com>
Reported-by: NBill Wendling <morbo@google.com>
Reported-by: NGreg Thelen <gthelen@google.com>
Reviewed-by: NNathan Chancellor <nathan@kernel.org>
Suggested-by: NMasahiro Yamada <masahiroy@kernel.org>
Signed-off-by: NNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
上级 61f2b7c7
...@@ -264,8 +264,10 @@ config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT ...@@ -264,8 +264,10 @@ config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
config DEBUG_INFO_DWARF4 config DEBUG_INFO_DWARF4
bool "Generate DWARF Version 4 debuginfo" bool "Generate DWARF Version 4 debuginfo"
select DEBUG_INFO select DEBUG_INFO
depends on !CC_IS_CLANG || (CC_IS_CLANG && (AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502)))
help help
Generate DWARF v4 debug info. This requires gcc 4.5+ and gdb 7.0+. Generate DWARF v4 debug info. This requires gcc 4.5+, binutils 2.35.2
if using clang without clang's integrated assembler, and gdb 7.0+.
If you have consumers of DWARF debug info that are not ready for If you have consumers of DWARF debug info that are not ready for
newer revisions of DWARF, you may wish to choose this or have your newer revisions of DWARF, you may wish to choose this or have your
......
DEBUG_CFLAGS := -g DEBUG_CFLAGS :=
debug-flags-y := -g
ifdef CONFIG_DEBUG_INFO_SPLIT ifdef CONFIG_DEBUG_INFO_SPLIT
DEBUG_CFLAGS += -gsplit-dwarf DEBUG_CFLAGS += -gsplit-dwarf
endif endif
ifndef CONFIG_AS_IS_LLVM debug-flags-$(CONFIG_DEBUG_INFO_DWARF4) += -gdwarf-4
KBUILD_AFLAGS += -Wa,-gdwarf-2 debug-flags-$(CONFIG_DEBUG_INFO_DWARF5) += -gdwarf-5
endif ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_AS_IS_GNU),yy)
# Clang does not pass -g or -gdwarf-* option down to GAS.
ifndef CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT # Add -Wa, prefix to explicitly specify the flags.
dwarf-version-$(CONFIG_DEBUG_INFO_DWARF4) := 4 KBUILD_AFLAGS += $(addprefix -Wa$(comma), $(debug-flags-y))
dwarf-version-$(CONFIG_DEBUG_INFO_DWARF5) := 5
DEBUG_CFLAGS += -gdwarf-$(dwarf-version-y)
endif endif
DEBUG_CFLAGS += $(debug-flags-y)
KBUILD_AFLAGS += $(debug-flags-y)
ifdef CONFIG_DEBUG_INFO_REDUCED ifdef CONFIG_DEBUG_INFO_REDUCED
DEBUG_CFLAGS += -fno-var-tracking DEBUG_CFLAGS += -fno-var-tracking
...@@ -27,5 +28,5 @@ KBUILD_AFLAGS += -gz=zlib ...@@ -27,5 +28,5 @@ KBUILD_AFLAGS += -gz=zlib
KBUILD_LDFLAGS += --compress-debug-sections=zlib KBUILD_LDFLAGS += --compress-debug-sections=zlib
endif endif
KBUILD_CFLAGS += $(DEBUG_CFLAGS) KBUILD_CFLAGS += $(DEBUG_CFLAGS)
export DEBUG_CFLAGS export DEBUG_CFLAGS
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册