public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Peixoto Ferreira <alexandref75@gmail.com>
To: Jiri Olsa <olsajiri@gmail.com>
Cc: Daniel Xu <dxu@dxuuu.xyz>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Subject: Re: Kernel build fail with 'btf_encoder__encode: btf__dedup failed!'
Date: Sat, 28 Jan 2023 13:23:25 -0600	[thread overview]
Message-ID: <883a3b03-a596-8279-1278-bc622114aab5@gmail.com> (raw)
In-Reply-To: <Y9RlpyV5JPz/hk1K@krava>

Jirka and Daniel,

On 1/27/23 18:00, Jiri Olsa wrote:
> On Fri, Jan 27, 2023 at 04:28:54PM -0600, Alexandre Peixoto Ferreira wrote:
>>
>> On 1/24/23 00:13, Daniel Xu wrote:
>>> Hi Jiri,
>>>
>>> On Mon, Jan 23, 2023, at 1:06 AM, Jiri Olsa wrote:
>>>> On Sun, Jan 22, 2023 at 10:48:44AM -0700, Daniel Xu wrote:
>>>>> Hi,
>>>>>
>>>>> I'm getting the following error during build:
>>>>>
>>>>>           $ ./tools/testing/selftests/bpf/vmtest.sh -j30
>>>>>           [...]
>>>>>             BTF     .btf.vmlinux.bin.o
>>>>>           btf_encoder__encode: btf__dedup failed!
>>>>>           Failed to encode BTF
>>>>>             LD      .tmp_vmlinux.kallsyms1
>>>>>             NM      .tmp_vmlinux.kallsyms1.syms
>>>>>             KSYMS   .tmp_vmlinux.kallsyms1.S
>>>>>             AS      .tmp_vmlinux.kallsyms1.S
>>>>>             LD      .tmp_vmlinux.kallsyms2
>>>>>             NM      .tmp_vmlinux.kallsyms2.syms
>>>>>             KSYMS   .tmp_vmlinux.kallsyms2.S
>>>>>             AS      .tmp_vmlinux.kallsyms2.S
>>>>>             LD      .tmp_vmlinux.kallsyms3
>>>>>             NM      .tmp_vmlinux.kallsyms3.syms
>>>>>             KSYMS   .tmp_vmlinux.kallsyms3.S
>>>>>             AS      .tmp_vmlinux.kallsyms3.S
>>>>>             LD      vmlinux
>>>>>             BTFIDS  vmlinux
>>>>>           FAILED: load BTF from vmlinux: No such file or directory
>>>>>           make[1]: *** [scripts/Makefile.vmlinux:35: vmlinux] Error 255
>>>>>           make[1]: *** Deleting file 'vmlinux'
>>>>>           make: *** [Makefile:1264: vmlinux] Error 2
>>>>>
>>>>> This happens on both bpf-next/master (84150795a49) and 6.2-rc5
>>>>> (2241ab53cb).
>>>>>
>>>>> I've also tried arch linux pahole 1:1.24+r29+g02d67c5-1 as well as
>>>>> upstream pahole on master (02d67c5176) and upstream pahole on
>>>>> next (2ca56f4c6f659).
>>>>>
>>>>> Of the above 6 combinations, I think I've tried all of them (maybe
>>>>> missing 1 or 2).
>>>>>
>>>>> Looks like GCC got updated recently on my machine, so perhaps
>>>>> it's related?
>>>>>
>>>>>           CONFIG_CC_VERSION_TEXT="gcc (GCC) 12.2.1 20230111"
>>>>>
>>>>> I'll try some debugging, but just wanted to report it first.
>>>> hi,
>>>> I can't reproduce that.. can you reproduce it outside vmtest.sh?
>>>>
>>>> there will be lot of output with patch below, but could contain
>>>> some more error output
>>> Thanks for the hints. Doing a regular build outside of vmtest.sh
>>> seems to work ok. So maybe it's a difference in the build config.
>>>
>>> I'll put a little more time into debugging to see if it goes anywhere.
>>> But I'll have to get back to the regularly scheduled programming
>>> soon.
>> 6.2-rc5 compiles correctly when CONFIG_X86_KERNEL_IBT is commented but fails
>> in pahole when CONFIG_X86_KERNEL_IBT is set.
> could you plese attach your config and the build error?
> I can't reproduce that
>
> thanks,
> jirka

My working .config is available at https://pastebin.pl/view/bef3765c
change CONFIG_X86_KERNEL_IBT to y to get the error.

The error is similar to Daniel's and is shown below:

   LD      .tmp_vmlinux.btf
   BTF     .btf.vmlinux.bin.o
btf_encoder__encode: btf__dedup failed!
Failed to encode BTF
   LD      .tmp_vmlinux.kallsyms1
   NM      .tmp_vmlinux.kallsyms1.syms
   KSYMS   .tmp_vmlinux.kallsyms1.S
   AS      .tmp_vmlinux.kallsyms1.S
   LD      .tmp_vmlinux.kallsyms2
   NM      .tmp_vmlinux.kallsyms2.syms
   KSYMS   .tmp_vmlinux.kallsyms2.S
   AS      .tmp_vmlinux.kallsyms2.S
   LD      .tmp_vmlinux.kallsyms3
   NM      .tmp_vmlinux.kallsyms3.syms
   KSYMS   .tmp_vmlinux.kallsyms3.S
   AS      .tmp_vmlinux.kallsyms3.S
   LD      vmlinux
   BTFIDS  vmlinux
FAILED: load BTF from vmlinux: No such file or directory
make[1]: *** [scripts/Makefile.vmlinux:35: vmlinux] Error 255
make[1]: *** Deleting file 'vmlinux'
make: *** [Makefile:1264: vmlinux] Error 2


Thanks,

-- 
Alexandre Peixoto Ferreira


  parent reply	other threads:[~2023-01-28 19:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-22 17:48 Kernel build fail with 'btf_encoder__encode: btf__dedup failed!' Daniel Xu
2023-01-22 21:25 ` Daniel Xu
2023-01-23  8:06 ` Jiri Olsa
2023-01-24  6:13   ` Daniel Xu
2023-01-27 22:28     ` Alexandre Peixoto Ferreira
2023-01-28  0:00       ` Jiri Olsa
2023-01-28  0:21         ` Daniel Xu
2023-01-28  0:23           ` Daniel Xu
2023-01-28 19:23         ` Alexandre Peixoto Ferreira [this message]
2023-01-31 15:18           ` Jiri Olsa
2023-02-09  0:21             ` Vicki Pfau
2023-02-09  4:15             ` Alexandre Peixoto Ferreira
2023-02-09 13:07               ` Alan Maguire
2023-02-10 14:02                 ` Alexandre Peixoto Ferreira
2023-02-10 14:34                   ` Jiri Olsa
2023-02-10 15:37                     ` Alexandre Ferreira
2023-02-14  6:33                       ` Tianyi Liu
2023-04-11 17:00                         ` [PATCH] vmlinux.lds.h: Force-align ELF notes section to four bytes Josh Poimboeuf
2023-04-12  7:10                           ` Tianyi Liu
2023-04-12 16:30                             ` Josh Poimboeuf
2023-04-13  2:21                               ` Joan Bruguera Micó
2023-04-13  9:23                                 ` Tianyi Liu
2023-04-13 18:59                                   ` [PATCH] vmlinux.lds.h: Discard .note.gnu.property section Josh Poimboeuf
2023-04-16 19:02                                     ` Joan Bruguera Micó
2023-04-18 21:47                                       ` Josh Poimboeuf
2023-04-18 21:49                                         ` [PATCH v2] " Josh Poimboeuf
2023-04-13  4:54                               ` [PATCH] vmlinux.lds.h: Force-align ELF notes section to four bytes Tianyi Liu
2023-04-16 18:52                                 ` Joan Bruguera Micó
2023-04-27  5:14                                   ` Joan Bruguera Micó

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=883a3b03-a596-8279-1278-bc622114aab5@gmail.com \
    --to=alexandref75@gmail.com \
    --cc=acme@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dxu@dxuuu.xyz \
    --cc=olsajiri@gmail.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