linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v1 0/2] arch: um: turn BTF_TYPEINFO support off
@ 2020-01-27 19:35 Brendan Higgins
  2020-01-27 19:35 ` [RFC v1 1/2] kbuild: add arch specific dependency for BTF support Brendan Higgins
  2020-01-27 19:35 ` [RFC v1 2/2] arch: um: turn BTF_TYPEINFO support off Brendan Higgins
  0 siblings, 2 replies; 6+ messages in thread
From: Brendan Higgins @ 2020-01-27 19:35 UTC (permalink / raw)
  To: jdike, richard, anton.ivanov, akpm, changbin.du, yamada.masahiro,
	rdunlap, keescook, andriy.shevchenko
  Cc: linux-um, linux-kernel, davidgow, heidifahim, Brendan Higgins

As a part of my quest to get allyesconfig working on UML, I found a new
build error, with CONFIG_DEBUG_INFO_BTF=y:

scripts/link-vmlinux.sh: line 106: 17463 Segmentation fault      LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1}
objcopy: --change-section-vma .BTF=0x0000000000000000 never used
objcopy: --change-section-lma .BTF=0x0000000000000000 never used
objcopy: error: the input file '.btf.vmlinux.bin' is empty
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make: *** [Makefile:1078: vmlinux] Error 1

The most interesting bit seems to be the:

objcopy: error: the input file '.btf.vmlinux.bin' is empty

Thinking about it, I am not sure if it makes sense for UML to produce
BTF type information, so I proposed a fix here that:

 1. Adds the ability for architectures to turn BTF support off.
 2. Turns BTF support off for UML.

I am also totally fine with just saying that DEBUG_INFO_BTF
depends on !UML, but I figured people would prefer this approach more.

Brendan Higgins (2):
  kbuild: add arch specific dependency for BTF support
  arch: um: turn BTF_TYPEINFO support off

 arch/um/Kconfig   | 1 +
 lib/Kconfig.debug | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

-- 
2.25.0.341.g760bfbb309-goog


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [RFC v1 1/2] kbuild: add arch specific dependency for BTF support
  2020-01-27 19:35 [RFC v1 0/2] arch: um: turn BTF_TYPEINFO support off Brendan Higgins
@ 2020-01-27 19:35 ` Brendan Higgins
  2020-01-28  3:27   ` Masahiro Yamada
  2020-01-27 19:35 ` [RFC v1 2/2] arch: um: turn BTF_TYPEINFO support off Brendan Higgins
  1 sibling, 1 reply; 6+ messages in thread
From: Brendan Higgins @ 2020-01-27 19:35 UTC (permalink / raw)
  To: jdike, richard, anton.ivanov, akpm, changbin.du, yamada.masahiro,
	rdunlap, keescook, andriy.shevchenko
  Cc: linux-um, linux-kernel, davidgow, heidifahim, Brendan Higgins

Some archs (like UM) do not build with CONFIG_DEBUG_INFO_BTF=y, so add
an options for archs to select to opt-in or out of BTF typeinfo support.

Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
---
 lib/Kconfig.debug | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index e4676b992eae9..f5bcb391f1b7d 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -238,9 +238,12 @@ config DEBUG_INFO_DWARF4
 	  But it significantly improves the success of resolving
 	  variables in gdb on optimized code.
 
+config ARCH_NO_BTF_TYPEINFO
+	bool
+
 config DEBUG_INFO_BTF
 	bool "Generate BTF typeinfo"
-	depends on DEBUG_INFO
+	depends on DEBUG_INFO && !ARCH_NO_BTF_TYPEINFO
 	help
 	  Generate deduplicated BTF type information from DWARF debug info.
 	  Turning this on expects presence of pahole tool, which will convert
-- 
2.25.0.341.g760bfbb309-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [RFC v1 2/2] arch: um: turn BTF_TYPEINFO support off
  2020-01-27 19:35 [RFC v1 0/2] arch: um: turn BTF_TYPEINFO support off Brendan Higgins
  2020-01-27 19:35 ` [RFC v1 1/2] kbuild: add arch specific dependency for BTF support Brendan Higgins
@ 2020-01-27 19:35 ` Brendan Higgins
  2020-01-28  8:12   ` Anton Ivanov
  1 sibling, 1 reply; 6+ messages in thread
From: Brendan Higgins @ 2020-01-27 19:35 UTC (permalink / raw)
  To: jdike, richard, anton.ivanov, akpm, changbin.du, yamada.masahiro,
	rdunlap, keescook, andriy.shevchenko
  Cc: linux-um, linux-kernel, davidgow, heidifahim, Brendan Higgins

Currently CONFIG_DEBUG_INFO_BTF=y doesn't work on UML:

scripts/link-vmlinux.sh: line 106: 17463 Segmentation fault      LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1}
objcopy: --change-section-vma .BTF=0x0000000000000000 never used
objcopy: --change-section-lma .BTF=0x0000000000000000 never used
objcopy: error: the input file '.btf.vmlinux.bin' is empty
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make: *** [Makefile:1078: vmlinux] Error 1

So turn off ARCH_HAS_BTF_TYPEINFO support off for the UM architecture.

Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
---
 arch/um/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 0917f8443c285..53e13d8b210e0 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -6,6 +6,7 @@ config UML
 	bool
 	default y
 	select ARCH_HAS_KCOV
+	select ARCH_NO_BTF_TYPEINFO
 	select ARCH_NO_PREEMPT
 	select HAVE_ARCH_AUDITSYSCALL
 	select HAVE_ARCH_SECCOMP_FILTER
-- 
2.25.0.341.g760bfbb309-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [RFC v1 1/2] kbuild: add arch specific dependency for BTF support
  2020-01-27 19:35 ` [RFC v1 1/2] kbuild: add arch specific dependency for BTF support Brendan Higgins
@ 2020-01-28  3:27   ` Masahiro Yamada
  2020-01-28  7:25     ` Brendan Higgins
  0 siblings, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2020-01-28  3:27 UTC (permalink / raw)
  To: Brendan Higgins
  Cc: Jeff Dike, Richard Weinberger, Anton Ivanov, Andrew Morton,
	Changbin Du, Randy Dunlap, Kees Cook, Andy Shevchenko, linux-um,
	Linux Kernel Mailing List, davidgow, heidifahim

Hi.

On Tue, Jan 28, 2020 at 4:36 AM Brendan Higgins
<brendanhiggins@google.com> wrote:
>
> Some archs (like UM) do not build with CONFIG_DEBUG_INFO_BTF=y, so add
> an options for archs to select to opt-in or out of BTF typeinfo support.


Could you use a different subject prefix (e.g. "btf:") ?

This is unrelated to kbuild.

Thanks.


> Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
> ---
>  lib/Kconfig.debug | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index e4676b992eae9..f5bcb391f1b7d 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -238,9 +238,12 @@ config DEBUG_INFO_DWARF4
>           But it significantly improves the success of resolving
>           variables in gdb on optimized code.
>
> +config ARCH_NO_BTF_TYPEINFO
> +       bool
> +
>  config DEBUG_INFO_BTF
>         bool "Generate BTF typeinfo"
> -       depends on DEBUG_INFO
> +       depends on DEBUG_INFO && !ARCH_NO_BTF_TYPEINFO
>         help
>           Generate deduplicated BTF type information from DWARF debug info.
>           Turning this on expects presence of pahole tool, which will convert
> --
> 2.25.0.341.g760bfbb309-goog
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC v1 1/2] kbuild: add arch specific dependency for BTF support
  2020-01-28  3:27   ` Masahiro Yamada
@ 2020-01-28  7:25     ` Brendan Higgins
  0 siblings, 0 replies; 6+ messages in thread
From: Brendan Higgins @ 2020-01-28  7:25 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Jeff Dike, Richard Weinberger, Anton Ivanov, Andrew Morton,
	Changbin Du, Randy Dunlap, Kees Cook, Andy Shevchenko, linux-um,
	Linux Kernel Mailing List, David Gow, Heidi Fahim

On Mon, Jan 27, 2020 at 7:28 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Hi.
>
> On Tue, Jan 28, 2020 at 4:36 AM Brendan Higgins
> <brendanhiggins@google.com> wrote:
> >
> > Some archs (like UM) do not build with CONFIG_DEBUG_INFO_BTF=y, so add
> > an options for archs to select to opt-in or out of BTF typeinfo support.
>
>
> Could you use a different subject prefix (e.g. "btf:") ?
>
> This is unrelated to kbuild.

Sure. My apologies, I just used the kbuild subject prefix because
that's what the previous commit that touched BTF used. Will fix in
next revision.

Thanks!

> > Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
> > ---
> >  lib/Kconfig.debug | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> > index e4676b992eae9..f5bcb391f1b7d 100644
> > --- a/lib/Kconfig.debug
> > +++ b/lib/Kconfig.debug
> > @@ -238,9 +238,12 @@ config DEBUG_INFO_DWARF4
> >           But it significantly improves the success of resolving
> >           variables in gdb on optimized code.
> >
> > +config ARCH_NO_BTF_TYPEINFO
> > +       bool
> > +
> >  config DEBUG_INFO_BTF
> >         bool "Generate BTF typeinfo"
> > -       depends on DEBUG_INFO
> > +       depends on DEBUG_INFO && !ARCH_NO_BTF_TYPEINFO
> >         help
> >           Generate deduplicated BTF type information from DWARF debug info.
> >           Turning this on expects presence of pahole tool, which will convert
> > --
> > 2.25.0.341.g760bfbb309-goog
> >
>
>
> --
> Best Regards
> Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC v1 2/2] arch: um: turn BTF_TYPEINFO support off
  2020-01-27 19:35 ` [RFC v1 2/2] arch: um: turn BTF_TYPEINFO support off Brendan Higgins
@ 2020-01-28  8:12   ` Anton Ivanov
  0 siblings, 0 replies; 6+ messages in thread
From: Anton Ivanov @ 2020-01-28  8:12 UTC (permalink / raw)
  To: Brendan Higgins, jdike, richard, akpm, changbin.du,
	yamada.masahiro, rdunlap, keescook, andriy.shevchenko
  Cc: linux-um, linux-kernel, davidgow, heidifahim



On 27/01/2020 19:35, Brendan Higgins wrote:
> Currently CONFIG_DEBUG_INFO_BTF=y doesn't work on UML:
> 
> scripts/link-vmlinux.sh: line 106: 17463 Segmentation fault      LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1}
> objcopy: --change-section-vma .BTF=0x0000000000000000 never used
> objcopy: --change-section-lma .BTF=0x0000000000000000 never used
> objcopy: error: the input file '.btf.vmlinux.bin' is empty
> Failed to generate BTF for vmlinux
> Try to disable CONFIG_DEBUG_INFO_BTF
> make: *** [Makefile:1078: vmlinux] Error 1
> 
> So turn off ARCH_HAS_BTF_TYPEINFO support off for the UM architecture.
> 
> Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
> ---
>   arch/um/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/um/Kconfig b/arch/um/Kconfig
> index 0917f8443c285..53e13d8b210e0 100644
> --- a/arch/um/Kconfig
> +++ b/arch/um/Kconfig
> @@ -6,6 +6,7 @@ config UML
>   	bool
>   	default y
>   	select ARCH_HAS_KCOV
> +	select ARCH_NO_BTF_TYPEINFO
>   	select ARCH_NO_PREEMPT
>   	select HAVE_ARCH_AUDITSYSCALL
>   	select HAVE_ARCH_SECCOMP_FILTER
> 

Acked-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>

-- 
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-28  8:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-27 19:35 [RFC v1 0/2] arch: um: turn BTF_TYPEINFO support off Brendan Higgins
2020-01-27 19:35 ` [RFC v1 1/2] kbuild: add arch specific dependency for BTF support Brendan Higgins
2020-01-28  3:27   ` Masahiro Yamada
2020-01-28  7:25     ` Brendan Higgins
2020-01-27 19:35 ` [RFC v1 2/2] arch: um: turn BTF_TYPEINFO support off Brendan Higgins
2020-01-28  8:12   ` Anton Ivanov

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).