diff mbox series

lib/Kconfig.debug: Restrict DEBUG_INFO_SPLIT for RISC-V

Message ID 20230816-riscv-debug_info_split-v1-1-d1019d6ccc11@kernel.org (mailing list archive)
State Accepted
Commit 9fa9a5f2714d2db3d994fb930e60697c2679a831
Headers show
Series lib/Kconfig.debug: Restrict DEBUG_INFO_SPLIT for RISC-V | expand

Checks

Context Check Description
conchuod/cover_letter success Single patches do not need cover letters
conchuod/tree_selection success Guessed tree name to be for-next at HEAD 174e8ac0272d
conchuod/fixes_present success Fixes tag not required for -next series
conchuod/maintainers_pattern success MAINTAINERS pattern errors before the patch: 4 and now 4
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/build_rv64_clang_allmodconfig success Errors and warnings before: 9 this patch: 9
conchuod/module_param success Was 0 now: 0
conchuod/build_rv64_gcc_allmodconfig success Errors and warnings before: 9 this patch: 9
conchuod/build_rv32_defconfig success Build OK
conchuod/dtb_warn_rv64 success Errors and warnings before: 12 this patch: 12
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
conchuod/build_rv64_nommu_k210_defconfig success Build OK
conchuod/verify_fixes success No Fixes tag
conchuod/build_rv64_nommu_virt_defconfig success Build OK

Commit Message

Nathan Chancellor Aug. 16, 2023, 5:35 p.m. UTC
When building for ARCH=riscv using LLVM < 14, there is an error with
CONFIG_DEBUG_INFO_SPLIT=y:

  error: A dwo section may not contain relocations

This was worked around in LLVM 15 by disallowing '-gsplit-dwarf' with
'-mrelax' (the default), so CONFIG_DEBUG_INFO_SPLIT is not selectable
with newer versions of LLVM:

  $ clang --target=riscv64-linux-gnu -gsplit-dwarf -c -o /dev/null -x c /dev/null
  clang: error: -gsplit-dwarf is unsupported with RISC-V linker relaxation (-mrelax)

GCC silently had a similar issue that was resolved with GCC 12.x.
Restrict CONFIG_DEBUG_INFO_SPLIT for RISC-V when using LLVM or GCC <
12.x to avoid these known issues.

Link: https://github.com/ClangBuiltLinux/linux/issues/1914
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/all/202308090204.9yZffBWo-lkp@intel.com/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Since this only impacts RISC-V, it seems reasonable that this would go
in via their tree but I have added Andrew in case he wants to take it.
---
 lib/Kconfig.debug | 5 +++++
 1 file changed, 5 insertions(+)


---
base-commit: 2ccdd1b13c591d306f0401d98dedc4bdcd02b421
change-id: 20230816-riscv-debug_info_split-0713571a1ac2

Best regards,

Comments

Fangrui Song Aug. 16, 2023, 10:04 p.m. UTC | #1
On 2023-08-16, Nathan Chancellor wrote:
>When building for ARCH=riscv using LLVM < 14, there is an error with
>CONFIG_DEBUG_INFO_SPLIT=y:
>
>  error: A dwo section may not contain relocations
>
>This was worked around in LLVM 15 by disallowing '-gsplit-dwarf' with
>'-mrelax' (the default), so CONFIG_DEBUG_INFO_SPLIT is not selectable
>with newer versions of LLVM:
>
>  $ clang --target=riscv64-linux-gnu -gsplit-dwarf -c -o /dev/null -x c /dev/null
>  clang: error: -gsplit-dwarf is unsupported with RISC-V linker relaxation (-mrelax)
>
>GCC silently had a similar issue that was resolved with GCC 12.x.
>Restrict CONFIG_DEBUG_INFO_SPLIT for RISC-V when using LLVM or GCC <
>12.x to avoid these known issues.
>
>Link: https://github.com/ClangBuiltLinux/linux/issues/1914
>Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
>Reported-by: kernel test robot <lkp@intel.com>
>Closes: https://lore.kernel.org/all/202308090204.9yZffBWo-lkp@intel.com/
>Signed-off-by: Nathan Chancellor <nathan@kernel.org>
>---
>Since this only impacts RISC-V, it seems reasonable that this would go
>in via their tree but I have added Andrew in case he wants to take it.
>---
> lib/Kconfig.debug | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
>index d6798513a8c2..bd51274f4771 100644
>--- a/lib/Kconfig.debug
>+++ b/lib/Kconfig.debug
>@@ -355,6 +355,11 @@ endchoice # "Compressed Debug information"
> config DEBUG_INFO_SPLIT
> 	bool "Produce split debuginfo in .dwo files"
> 	depends on $(cc-option,-gsplit-dwarf)
>+	# RISC-V linker relaxation + -gsplit-dwarf has issues with LLVM and GCC
>+	# prior to 12.x:
>+	# https://github.com/llvm/llvm-project/issues/56642
>+	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
>+	depends on !RISCV || GCC_VERSION >= 120000
> 	help
> 	  Generate debug info into separate .dwo files. This significantly
> 	  reduces the build directory size for builds with DEBUG_INFO,
>
>---
>base-commit: 2ccdd1b13c591d306f0401d98dedc4bdcd02b421
>change-id: 20230816-riscv-debug_info_split-0713571a1ac2
>
>Best regards,
>-- 
>Nathan Chancellor <nathan@kernel.org>
>

LGTM as the author of the Clang mitigation
(https://github.com/llvm/llvm-project/issues/56642) and several recent
LLVM assembler side linker relaxation improvement (I continue updating
https://maskray.me/blog/2021-03-14-the-dark-side-of-riscv-linker-relaxation
about the complication of linker relaxation).

Reviewed-by: Fangrui Song <maskray@google.com>
Nick Desaulniers Aug. 16, 2023, 10:35 p.m. UTC | #2
On Wed, Aug 16, 2023 at 3:05 PM Fangrui Song <maskray@google.com> wrote:
>
> On 2023-08-16, Nathan Chancellor wrote:
> >When building for ARCH=riscv using LLVM < 14, there is an error with
> >CONFIG_DEBUG_INFO_SPLIT=y:
> >
> >  error: A dwo section may not contain relocations
> >
> >This was worked around in LLVM 15 by disallowing '-gsplit-dwarf' with
> >'-mrelax' (the default), so CONFIG_DEBUG_INFO_SPLIT is not selectable
> >with newer versions of LLVM:
> >
> >  $ clang --target=riscv64-linux-gnu -gsplit-dwarf -c -o /dev/null -x c /dev/null
> >  clang: error: -gsplit-dwarf is unsupported with RISC-V linker relaxation (-mrelax)
> >
> >GCC silently had a similar issue that was resolved with GCC 12.x.
> >Restrict CONFIG_DEBUG_INFO_SPLIT for RISC-V when using LLVM or GCC <
> >12.x to avoid these known issues.
> >
> >Link: https://github.com/ClangBuiltLinux/linux/issues/1914
> >Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
> >Reported-by: kernel test robot <lkp@intel.com>
> >Closes: https://lore.kernel.org/all/202308090204.9yZffBWo-lkp@intel.com/
> >Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> >---
> >Since this only impacts RISC-V, it seems reasonable that this would go
> >in via their tree but I have added Andrew in case he wants to take it.
> >---
> > lib/Kconfig.debug | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> >diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> >index d6798513a8c2..bd51274f4771 100644
> >--- a/lib/Kconfig.debug
> >+++ b/lib/Kconfig.debug
> >@@ -355,6 +355,11 @@ endchoice # "Compressed Debug information"
> > config DEBUG_INFO_SPLIT
> >       bool "Produce split debuginfo in .dwo files"
> >       depends on $(cc-option,-gsplit-dwarf)
> >+      # RISC-V linker relaxation + -gsplit-dwarf has issues with LLVM and GCC
> >+      # prior to 12.x:
> >+      # https://github.com/llvm/llvm-project/issues/56642
> >+      # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
> >+      depends on !RISCV || GCC_VERSION >= 120000

Thanks for the patch. I was initially surprised to see no explicit
check for LLVM version.  Rereading the commit description a few times,
I think it makes sense, but I'm guessing we may need to rework this
condition again should we eventually get split debug info working for
riscv for llvm.  I am looking to enable split debug info for kernels
for Android's next release.

Fangrui, any thoughts on feasibility for `-mrelax` and `-gsplit-dwarf`
composability for llvm?

Link: https://github.com/llvm/llvm-project/issues/56642
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> >       help
> >         Generate debug info into separate .dwo files. This significantly
> >         reduces the build directory size for builds with DEBUG_INFO,
> >
> >---
> >base-commit: 2ccdd1b13c591d306f0401d98dedc4bdcd02b421
> >change-id: 20230816-riscv-debug_info_split-0713571a1ac2
> >
> >Best regards,
> >--
> >Nathan Chancellor <nathan@kernel.org>
> >
>
> LGTM as the author of the Clang mitigation
> (https://github.com/llvm/llvm-project/issues/56642) and several recent
> LLVM assembler side linker relaxation improvement (I continue updating
> https://maskray.me/blog/2021-03-14-the-dark-side-of-riscv-linker-relaxation
> about the complication of linker relaxation).
>
> Reviewed-by: Fangrui Song <maskray@google.com>
Fangrui Song Aug. 16, 2023, 10:41 p.m. UTC | #3
On Wed, Aug 16, 2023 at 3:35 PM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> On Wed, Aug 16, 2023 at 3:05 PM Fangrui Song <maskray@google.com> wrote:
> >
> > On 2023-08-16, Nathan Chancellor wrote:
> > >When building for ARCH=riscv using LLVM < 14, there is an error with
> > >CONFIG_DEBUG_INFO_SPLIT=y:
> > >
> > >  error: A dwo section may not contain relocations
> > >
> > >This was worked around in LLVM 15 by disallowing '-gsplit-dwarf' with
> > >'-mrelax' (the default), so CONFIG_DEBUG_INFO_SPLIT is not selectable
> > >with newer versions of LLVM:
> > >
> > >  $ clang --target=riscv64-linux-gnu -gsplit-dwarf -c -o /dev/null -x c /dev/null
> > >  clang: error: -gsplit-dwarf is unsupported with RISC-V linker relaxation (-mrelax)
> > >
> > >GCC silently had a similar issue that was resolved with GCC 12.x.
> > >Restrict CONFIG_DEBUG_INFO_SPLIT for RISC-V when using LLVM or GCC <
> > >12.x to avoid these known issues.
> > >
> > >Link: https://github.com/ClangBuiltLinux/linux/issues/1914
> > >Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
> > >Reported-by: kernel test robot <lkp@intel.com>
> > >Closes: https://lore.kernel.org/all/202308090204.9yZffBWo-lkp@intel.com/
> > >Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> > >---
> > >Since this only impacts RISC-V, it seems reasonable that this would go
> > >in via their tree but I have added Andrew in case he wants to take it.
> > >---
> > > lib/Kconfig.debug | 5 +++++
> > > 1 file changed, 5 insertions(+)
> > >
> > >diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> > >index d6798513a8c2..bd51274f4771 100644
> > >--- a/lib/Kconfig.debug
> > >+++ b/lib/Kconfig.debug
> > >@@ -355,6 +355,11 @@ endchoice # "Compressed Debug information"
> > > config DEBUG_INFO_SPLIT
> > >       bool "Produce split debuginfo in .dwo files"
> > >       depends on $(cc-option,-gsplit-dwarf)
> > >+      # RISC-V linker relaxation + -gsplit-dwarf has issues with LLVM and GCC
> > >+      # prior to 12.x:
> > >+      # https://github.com/llvm/llvm-project/issues/56642
> > >+      # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
> > >+      depends on !RISCV || GCC_VERSION >= 120000
>
> Thanks for the patch. I was initially surprised to see no explicit
> check for LLVM version.  Rereading the commit description a few times,
> I think it makes sense, but I'm guessing we may need to rework this
> condition again should we eventually get split debug info working for
> riscv for llvm.  I am looking to enable split debug info for kernels
> for Android's next release.
>
> Fangrui, any thoughts on feasibility for `-mrelax` and `-gsplit-dwarf`
> composability for llvm?

Yes, this should be feasible and is on my radar
(https://github.com/llvm/llvm-project/issues/56642#issuecomment-1548421026).

It's the next thing I'll do in my spare time after DWARF v5 & linker
relaxation interop: https://reviews.llvm.org/D157657

> Link: https://github.com/llvm/llvm-project/issues/56642
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
>
> > >       help
> > >         Generate debug info into separate .dwo files. This significantly
> > >         reduces the build directory size for builds with DEBUG_INFO,
> > >
> > >---
> > >base-commit: 2ccdd1b13c591d306f0401d98dedc4bdcd02b421
> > >change-id: 20230816-riscv-debug_info_split-0713571a1ac2
> > >
> > >Best regards,
> > >--
> > >Nathan Chancellor <nathan@kernel.org>
> > >
> >
> > LGTM as the author of the Clang mitigation
> > (https://github.com/llvm/llvm-project/issues/56642) and several recent
> > LLVM assembler side linker relaxation improvement (I continue updating
> > https://maskray.me/blog/2021-03-14-the-dark-side-of-riscv-linker-relaxation
> > about the complication of linker relaxation).
> >
> > Reviewed-by: Fangrui Song <maskray@google.com>
>
>
>
> --
> Thanks,
> ~Nick Desaulniers
Nick Desaulniers Aug. 16, 2023, 10:43 p.m. UTC | #4
On Wed, Aug 16, 2023 at 3:41 PM Fangrui Song <maskray@google.com> wrote:
>
> On Wed, Aug 16, 2023 at 3:35 PM Nick Desaulniers
> > Fangrui, any thoughts on feasibility for `-mrelax` and `-gsplit-dwarf`
> > composability for llvm?
>
> Yes, this should be feasible and is on my radar
> (https://github.com/llvm/llvm-project/issues/56642#issuecomment-1548421026).
>
> It's the next thing I'll do in my spare time after DWARF v5 & linker
> relaxation interop: https://reviews.llvm.org/D157657

Cool, I've removed Saleem from the assignee field there and penciled
you in; both because I think Saleem has new concerns and so that you
don't lose track of it.  Thank you.
patchwork-bot+linux-riscv@kernel.org Aug. 30, 2023, 1:20 p.m. UTC | #5
Hello:

This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Wed, 16 Aug 2023 10:35:43 -0700 you wrote:
> When building for ARCH=riscv using LLVM < 14, there is an error with
> CONFIG_DEBUG_INFO_SPLIT=y:
> 
>   error: A dwo section may not contain relocations
> 
> This was worked around in LLVM 15 by disallowing '-gsplit-dwarf' with
> '-mrelax' (the default), so CONFIG_DEBUG_INFO_SPLIT is not selectable
> with newer versions of LLVM:
> 
> [...]

Here is the summary with links:
  - lib/Kconfig.debug: Restrict DEBUG_INFO_SPLIT for RISC-V
    https://git.kernel.org/riscv/c/9fa9a5f2714d

You are awesome, thank you!
Palmer Dabbelt Aug. 30, 2023, 1:22 p.m. UTC | #6
On Wed, 16 Aug 2023 10:35:43 PDT (-0700), nathan@kernel.org wrote:
> When building for ARCH=riscv using LLVM < 14, there is an error with
> CONFIG_DEBUG_INFO_SPLIT=y:
>
>   error: A dwo section may not contain relocations
>
> This was worked around in LLVM 15 by disallowing '-gsplit-dwarf' with
> '-mrelax' (the default), so CONFIG_DEBUG_INFO_SPLIT is not selectable
> with newer versions of LLVM:
>
>   $ clang --target=riscv64-linux-gnu -gsplit-dwarf -c -o /dev/null -x c /dev/null
>   clang: error: -gsplit-dwarf is unsupported with RISC-V linker relaxation (-mrelax)
>
> GCC silently had a similar issue that was resolved with GCC 12.x.
> Restrict CONFIG_DEBUG_INFO_SPLIT for RISC-V when using LLVM or GCC <
> 12.x to avoid these known issues.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1914
> Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/all/202308090204.9yZffBWo-lkp@intel.com/
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> Since this only impacts RISC-V, it seems reasonable that this would go
> in via their tree but I have added Andrew in case he wants to take it.
> ---
>  lib/Kconfig.debug | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index d6798513a8c2..bd51274f4771 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -355,6 +355,11 @@ endchoice # "Compressed Debug information"
>  config DEBUG_INFO_SPLIT
>  	bool "Produce split debuginfo in .dwo files"
>  	depends on $(cc-option,-gsplit-dwarf)
> +	# RISC-V linker relaxation + -gsplit-dwarf has issues with LLVM and GCC
> +	# prior to 12.x:
> +	# https://github.com/llvm/llvm-project/issues/56642
> +	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
> +	depends on !RISCV || GCC_VERSION >= 120000
>  	help
>  	  Generate debug info into separate .dwo files. This significantly
>  	  reduces the build directory size for builds with DEBUG_INFO,

Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>

Not sure who's taking stuff for lib/Kconfig.debug, I can take it via the 
RISC-V tree if folks are OK with it.  Kees and Andrew were the last to 
touch it.

>
> ---
> base-commit: 2ccdd1b13c591d306f0401d98dedc4bdcd02b421
> change-id: 20230816-riscv-debug_info_split-0713571a1ac2
>
> Best regards,
Nathan Chancellor Aug. 30, 2023, 3:36 p.m. UTC | #7
On Wed, Aug 30, 2023 at 06:22:45AM -0700, Palmer Dabbelt wrote:
> On Wed, 16 Aug 2023 10:35:43 PDT (-0700), nathan@kernel.org wrote:
> > When building for ARCH=riscv using LLVM < 14, there is an error with
> > CONFIG_DEBUG_INFO_SPLIT=y:
> > 
> >   error: A dwo section may not contain relocations
> > 
> > This was worked around in LLVM 15 by disallowing '-gsplit-dwarf' with
> > '-mrelax' (the default), so CONFIG_DEBUG_INFO_SPLIT is not selectable
> > with newer versions of LLVM:
> > 
> >   $ clang --target=riscv64-linux-gnu -gsplit-dwarf -c -o /dev/null -x c /dev/null
> >   clang: error: -gsplit-dwarf is unsupported with RISC-V linker relaxation (-mrelax)
> > 
> > GCC silently had a similar issue that was resolved with GCC 12.x.
> > Restrict CONFIG_DEBUG_INFO_SPLIT for RISC-V when using LLVM or GCC <
> > 12.x to avoid these known issues.
> > 
> > Link: https://github.com/ClangBuiltLinux/linux/issues/1914
> > Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/all/202308090204.9yZffBWo-lkp@intel.com/
> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> > ---
> > Since this only impacts RISC-V, it seems reasonable that this would go
> > in via their tree but I have added Andrew in case he wants to take it.
> > ---
> >  lib/Kconfig.debug | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> > index d6798513a8c2..bd51274f4771 100644
> > --- a/lib/Kconfig.debug
> > +++ b/lib/Kconfig.debug
> > @@ -355,6 +355,11 @@ endchoice # "Compressed Debug information"
> >  config DEBUG_INFO_SPLIT
> >  	bool "Produce split debuginfo in .dwo files"
> >  	depends on $(cc-option,-gsplit-dwarf)
> > +	# RISC-V linker relaxation + -gsplit-dwarf has issues with LLVM and GCC
> > +	# prior to 12.x:
> > +	# https://github.com/llvm/llvm-project/issues/56642
> > +	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
> > +	depends on !RISCV || GCC_VERSION >= 120000
> >  	help
> >  	  Generate debug info into separate .dwo files. This significantly
> >  	  reduces the build directory size for builds with DEBUG_INFO,
> 
> Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
> 
> Not sure who's taking stuff for lib/Kconfig.debug, I can take it via the
> RISC-V tree if folks are OK with it.  Kees and Andrew were the last to touch
> it.

I don't think lib/Kconfig.debug has a formal maintainer. Given that and
the fact that this change only affects RISC-V, I think it is entirely
reasonable for you to take it.

Cheers,
Nathan
Kees Cook Aug. 30, 2023, 11:44 p.m. UTC | #8
On Wed, Aug 30, 2023 at 08:36:46AM -0700, Nathan Chancellor wrote:
> On Wed, Aug 30, 2023 at 06:22:45AM -0700, Palmer Dabbelt wrote:
> > On Wed, 16 Aug 2023 10:35:43 PDT (-0700), nathan@kernel.org wrote:
> > > When building for ARCH=riscv using LLVM < 14, there is an error with
> > > CONFIG_DEBUG_INFO_SPLIT=y:
> > > 
> > >   error: A dwo section may not contain relocations
> > > 
> > > This was worked around in LLVM 15 by disallowing '-gsplit-dwarf' with
> > > '-mrelax' (the default), so CONFIG_DEBUG_INFO_SPLIT is not selectable
> > > with newer versions of LLVM:
> > > 
> > >   $ clang --target=riscv64-linux-gnu -gsplit-dwarf -c -o /dev/null -x c /dev/null
> > >   clang: error: -gsplit-dwarf is unsupported with RISC-V linker relaxation (-mrelax)
> > > 
> > > GCC silently had a similar issue that was resolved with GCC 12.x.
> > > Restrict CONFIG_DEBUG_INFO_SPLIT for RISC-V when using LLVM or GCC <
> > > 12.x to avoid these known issues.
> > > 
> > > Link: https://github.com/ClangBuiltLinux/linux/issues/1914
> > > Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
> > > Reported-by: kernel test robot <lkp@intel.com>
> > > Closes: https://lore.kernel.org/all/202308090204.9yZffBWo-lkp@intel.com/
> > > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> > > ---
> > > Since this only impacts RISC-V, it seems reasonable that this would go
> > > in via their tree but I have added Andrew in case he wants to take it.
> > > ---
> > >  lib/Kconfig.debug | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> > > index d6798513a8c2..bd51274f4771 100644
> > > --- a/lib/Kconfig.debug
> > > +++ b/lib/Kconfig.debug
> > > @@ -355,6 +355,11 @@ endchoice # "Compressed Debug information"
> > >  config DEBUG_INFO_SPLIT
> > >  	bool "Produce split debuginfo in .dwo files"
> > >  	depends on $(cc-option,-gsplit-dwarf)
> > > +	# RISC-V linker relaxation + -gsplit-dwarf has issues with LLVM and GCC
> > > +	# prior to 12.x:
> > > +	# https://github.com/llvm/llvm-project/issues/56642
> > > +	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
> > > +	depends on !RISCV || GCC_VERSION >= 120000
> > >  	help
> > >  	  Generate debug info into separate .dwo files. This significantly
> > >  	  reduces the build directory size for builds with DEBUG_INFO,
> > 
> > Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
> > Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
> > 
> > Not sure who's taking stuff for lib/Kconfig.debug, I can take it via the
> > RISC-V tree if folks are OK with it.  Kees and Andrew were the last to touch
> > it.
> 
> I don't think lib/Kconfig.debug has a formal maintainer. Given that and
> the fact that this change only affects RISC-V, I think it is entirely
> reasonable for you to take it.

Agreed -- got for it. :)
diff mbox series

Patch

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index d6798513a8c2..bd51274f4771 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -355,6 +355,11 @@  endchoice # "Compressed Debug information"
 config DEBUG_INFO_SPLIT
 	bool "Produce split debuginfo in .dwo files"
 	depends on $(cc-option,-gsplit-dwarf)
+	# RISC-V linker relaxation + -gsplit-dwarf has issues with LLVM and GCC
+	# prior to 12.x:
+	# https://github.com/llvm/llvm-project/issues/56642
+	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
+	depends on !RISCV || GCC_VERSION >= 120000
 	help
 	  Generate debug info into separate .dwo files. This significantly
 	  reduces the build directory size for builds with DEBUG_INFO,