patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Palmer Dabbelt <palmer@dabbelt.com>
Cc: keescook@chromium.org, akpm@linux-foundation.org,
	Paul Walmsley <paul.walmsley@sifive.com>,
	aou@eecs.berkeley.edu, Conor Dooley <conor@kernel.org>,
	ndesaulniers@google.com, trix@redhat.com,
	linux-riscv@lists.infradead.org, llvm@lists.linux.dev,
	patches@lists.linux.dev, lkp@intel.com
Subject: Re: [PATCH] lib/Kconfig.debug: Restrict DEBUG_INFO_SPLIT for RISC-V
Date: Wed, 30 Aug 2023 08:36:46 -0700	[thread overview]
Message-ID: <20230830153646.GA954264@dev-arch.thelio-3990X> (raw)
In-Reply-To: <mhng-747958b0-514c-4fc8-ac37-0769562ba385@palmer-ri-x1c9>

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

  reply	other threads:[~2023-08-30 15:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16 17:35 [PATCH] lib/Kconfig.debug: Restrict DEBUG_INFO_SPLIT for RISC-V Nathan Chancellor
2023-08-16 22:04 ` Fangrui Song
2023-08-16 22:35   ` Nick Desaulniers
2023-08-16 22:41     ` Fangrui Song
2023-08-16 22:43       ` Nick Desaulniers
2023-08-30 13:20 ` patchwork-bot+linux-riscv
2023-08-30 13:22 ` Palmer Dabbelt
2023-08-30 15:36   ` Nathan Chancellor [this message]
2023-08-30 23:44     ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230830153646.GA954264@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=ndesaulniers@google.com \
    --cc=palmer@dabbelt.com \
    --cc=patches@lists.linux.dev \
    --cc=paul.walmsley@sifive.com \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).