Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux-block.git] / lib / Kconfig.debug
index 3761118d1879aecf404939c9daf0baa03512c179..3fc7abffc7aa20e0851a50216fb82f7febcbceea 100644 (file)
@@ -231,6 +231,11 @@ config DEBUG_INFO
          in the "Debug information" choice below, indicating that debug
          information will be generated for build targets.
 
+# Clang is known to generate .{s,u}leb128 with symbol deltas with DWARF5, which
+# some targets may not support: https://sourceware.org/bugzilla/show_bug.cgi?id=27215
+config AS_HAS_NON_CONST_LEB128
+       def_bool $(as-instr,.uleb128 .Lexpr_end4 - .Lexpr_start3\n.Lexpr_start3:\n.Lexpr_end4:)
+
 choice
        prompt "Debug information"
        depends on DEBUG_KERNEL
@@ -253,6 +258,7 @@ config DEBUG_INFO_NONE
 config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
        bool "Rely on the toolchain's implicit default DWARF version"
        select DEBUG_INFO
+       depends on !CC_IS_CLANG || AS_IS_LLVM || CLANG_VERSION < 140000 || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_LEB128)
        help
          The implicit default version of DWARF debug info produced by a
          toolchain changes over time.
@@ -264,7 +270,7 @@ config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
 config DEBUG_INFO_DWARF4
        bool "Generate DWARF Version 4 debuginfo"
        select DEBUG_INFO
-       depends on !CC_IS_CLANG || (CC_IS_CLANG && (AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502)))
+       depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502)
        help
          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+.
@@ -276,7 +282,7 @@ config DEBUG_INFO_DWARF4
 config DEBUG_INFO_DWARF5
        bool "Generate DWARF Version 5 debuginfo"
        select DEBUG_INFO
-       depends on !CC_IS_CLANG || (CC_IS_CLANG && (AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502)))
+       depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_LEB128)
        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
@@ -817,13 +823,12 @@ config DEBUG_VM
 
          If unsure, say N.
 
-config DEBUG_VM_VMACACHE
-       bool "Debug VMA caching"
+config DEBUG_VM_MAPLE_TREE
+       bool "Debug VM maple trees"
        depends on DEBUG_VM
+       select DEBUG_MAPLE_TREE
        help
-         Enable this to turn on VMA caching debug information. Doing so
-         can cause significant overhead, so only enable it in non-production
-         environments.
+         Enable VM maple tree debugging information and extra validations.
 
          If unsure, say N.
 
@@ -976,6 +981,7 @@ config DEBUG_STACKOVERFLOW
 
 source "lib/Kconfig.kasan"
 source "lib/Kconfig.kfence"
+source "lib/Kconfig.kmsan"
 
 endmenu # "Memory Debugging"
 
@@ -1640,6 +1646,14 @@ config BUG_ON_DATA_CORRUPTION
 
          If unsure, say N.
 
+config DEBUG_MAPLE_TREE
+       bool "Debug maple trees"
+       depends on DEBUG_KERNEL
+       help
+         Enable maple tree debugging information and extra validations.
+
+         If unsure, say N.
+
 endmenu
 
 config DEBUG_CREDENTIALS