Commit a4426641 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Palmer Dabbelt

lib/Kconfig.debug: Update AS_HAS_NON_CONST_LEB128 comment and name

Fangrui noted that the comment around CONFIG_AS_HAS_NON_CONST_LEB128
could be made more accurate because explicit .sleb128 directives are not
emitted, only .uleb128 directives are. Rename the symbol to
CONFIG_AS_HAS_NON_CONST_ULEB128 as a result.

Further clarifications include replacing "symbol deltas" with the more
accurate "label differences", noting that this issue has been resolved
in newer binutils (2.41+), and it only occurs when a port uses RISC-V
style linker relaxation.
Suggested-by: default avatarFangrui Song <maskray@google.com>
Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Reviewed-by: default avatarCharlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20231205-riscv-restrict-dwarf5-llvm-v2-3-aedf00a382ac@kernel.orgSigned-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent ae84ff9a
...@@ -231,9 +231,10 @@ config DEBUG_INFO ...@@ -231,9 +231,10 @@ config DEBUG_INFO
in the "Debug information" choice below, indicating that debug in the "Debug information" choice below, indicating that debug
information will be generated for build targets. information will be generated for build targets.
# Clang is known to generate .{s,u}leb128 with symbol deltas with DWARF5, which # Clang generates .uleb128 with label differences for DWARF v5, a feature that
# some targets may not support: https://sourceware.org/bugzilla/show_bug.cgi?id=27215 # older binutils ports do not support when utilizing RISC-V style linker
config AS_HAS_NON_CONST_LEB128 # relaxation: https://sourceware.org/bugzilla/show_bug.cgi?id=27215
config AS_HAS_NON_CONST_ULEB128
def_bool $(as-instr,.uleb128 .Lexpr_end4 - .Lexpr_start3\n.Lexpr_start3:\n.Lexpr_end4:) def_bool $(as-instr,.uleb128 .Lexpr_end4 - .Lexpr_start3\n.Lexpr_start3:\n.Lexpr_end4:)
choice choice
...@@ -258,7 +259,7 @@ config DEBUG_INFO_NONE ...@@ -258,7 +259,7 @@ config DEBUG_INFO_NONE
config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
bool "Rely on the toolchain's implicit default DWARF version" bool "Rely on the toolchain's implicit default DWARF version"
select DEBUG_INFO 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) depends on !CC_IS_CLANG || AS_IS_LLVM || CLANG_VERSION < 140000 || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_ULEB128)
help help
The implicit default version of DWARF debug info produced by a The implicit default version of DWARF debug info produced by a
toolchain changes over time. toolchain changes over time.
...@@ -283,7 +284,7 @@ config DEBUG_INFO_DWARF5 ...@@ -283,7 +284,7 @@ config DEBUG_INFO_DWARF5
bool "Generate DWARF Version 5 debuginfo" bool "Generate DWARF Version 5 debuginfo"
select DEBUG_INFO select DEBUG_INFO
depends on !ARCH_HAS_BROKEN_DWARF5 depends on !ARCH_HAS_BROKEN_DWARF5
depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_LEB128) depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_ULEB128)
help help
Generate DWARF v5 debug info. Requires binutils 2.35.2, gcc 5.0+ (gcc 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 5.0+ accepts the -gdwarf-5 flag but only had partial support for some
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment