Merge tag 'kbuild-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[linux-2.6-microblaze.git] / lib / Kconfig.debug
index 7937265..f9febff 100644 (file)
@@ -256,14 +256,51 @@ config DEBUG_INFO_SPLIT
          to know about the .dwo files and include them.
          Incompatible with older versions of ccache.
 
+choice
+       prompt "DWARF version"
+       help
+         Which version of DWARF debug info to emit.
+
+config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
+       bool "Rely on the toolchain's implicit default DWARF version"
+       help
+         The implicit default version of DWARF debug info produced by a
+         toolchain changes over time.
+
+         This can break consumers of the debug info that haven't upgraded to
+         support newer revisions, and prevent testing newer versions, but
+         those should be less common scenarios.
+
+         If unsure, say Y.
+
 config DEBUG_INFO_DWARF4
-       bool "Generate dwarf4 debuginfo"
-       depends on $(cc-option,-gdwarf-4)
+       bool "Generate DWARF Version 4 debuginfo"
        help
-         Generate dwarf4 debug info. This requires recent versions
-         of gcc and gdb. It makes the debug information larger.
-         But it significantly improves the success of resolving
-         variables in gdb on optimized code.
+         Generate DWARF v4 debug info. This requires gcc 4.5+ and gdb 7.0+.
+
+         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
+         config select this.
+
+config DEBUG_INFO_DWARF5
+       bool "Generate DWARF Version 5 debuginfo"
+       depends on GCC_VERSION >= 50000 || CC_IS_CLANG
+       depends on CC_IS_GCC || $(success,$(srctree)/scripts/test_dwarf5_support.sh $(CC) $(CLANG_FLAGS))
+       depends on !DEBUG_INFO_BTF
+       help
+         Generate DWARF v5 debug info. Requires binutils 2.35.2, gcc 5.0+ (gcc
+         5.0+ accepts the -gdwarf-5 flag but only had partial support for some
+         draft features until 7.0), and gdb 8.0+.
+
+         Changes to the structure of debug info in Version 5 allow for around
+         15-18% savings in resulting image and debug info section sizes as
+         compared to DWARF Version 4. DWARF Version 5 standardizes previous
+         extensions such as accelerators for symbol indexing and the format
+         for fission (.dwo/.dwp) files. Users may not want to select this
+         config if they rely on tooling that has not yet been updated to
+         support DWARF Version 5.
+
+endchoice # "DWARF version"
 
 config DEBUG_INFO_BTF
        bool "Generate BTF typeinfo"
@@ -1335,6 +1372,7 @@ config LOCKDEP_SMALL
 config DEBUG_LOCKDEP
        bool "Lock dependency engine debugging"
        depends on DEBUG_KERNEL && LOCKDEP
+       select DEBUG_IRQFLAGS
        help
          If you say Y here, the lock dependency engine will do
          additional runtime checks to debug itself, at the price
@@ -1423,6 +1461,13 @@ config TRACE_IRQFLAGS_NMI
        depends on TRACE_IRQFLAGS
        depends on TRACE_IRQFLAGS_NMI_SUPPORT
 
+config DEBUG_IRQFLAGS
+       bool "Debug IRQ flag manipulation"
+       help
+         Enables checks for potentially unsafe enabling or disabling of
+         interrupts, such as calling raw_local_irq_restore() when interrupts
+         are enabled.
+
 config STACKTRACE
        bool "Stack backtrace support"
        depends on STACKTRACE_SUPPORT