失敗:vmlinuxからbtfを読み込む:CONFIG_DEBUG_INFO_BTF = yで無効なパラメータを作成する

失敗:vmlinuxからbtfを読み込む:CONFIG_DEBUG_INFO_BTF = yで無効なパラメータを作成する

linux-5.14.2.tar.gzコンパイル時に次のエラーが発生しました。patch-5.14.2-rt21.patch

 on CONFIG_DEBUG_INFO_BTF=y:

      AS      arch/x86/lib/iomap_copy_64.o
    arch/x86/lib/iomap_copy_64.S: Assembler messages:
    arch/x86/lib/iomap_copy_64.S:13: 警告:found `movsd'; assuming `movsl' was meant
      AR      arch/x86/lib/built-in.a
      GEN     .version
      CHK     include/generated/compile.h
      LD      vmlinux.o
    ld: warning: arch/x86/power/hibernate_asm_64.o: missing .note.GNU-stack section implies executable stack
    ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
      MODPOST vmlinux.symvers
      MODINFO modules.builtin.modinfo
      GEN     modules.builtin
      LD      .tmp_vmlinux.btf
    ld: warning: arch/x86/power/hibernate_asm_64.o: missing .note.GNU-stack section implies executable stack
    ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
    ld: warning: .tmp_vmlinux.btf has a LOAD segment with RWX permissions
      BTF     .btf.vmlinux.bin.o
      LD      .tmp_vmlinux.kallsyms1
    ld: warning: .btf.vmlinux.bin.o: missing .note.GNU-stack section implies executable stack
    ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
    ld: warning: .tmp_vmlinux.kallsyms1 has a LOAD segment with RWX permissions
      KSYMS   .tmp_vmlinux.kallsyms1.S
      AS      .tmp_vmlinux.kallsyms1.S
      LD      .tmp_vmlinux.kallsyms2
    ld: warning: .btf.vmlinux.bin.o: missing .note.GNU-stack section implies executable stack
    ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
    ld: warning: .tmp_vmlinux.kallsyms2 has a LOAD segment with RWX permissions
      KSYMS   .tmp_vmlinux.kallsyms2.S
      AS      .tmp_vmlinux.kallsyms2.S
      LD      vmlinux
    ld: warning: .btf.vmlinux.bin.o: missing .note.GNU-stack section implies executable stack
    ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
    ld: warning: vmlinux has a LOAD segment with RWX permissions
      BTFIDS  vmlinux

    failed: load btf from vmlinux: invalid argument make:
    make: *** [Makefile:1176: vmlinux] Error 255
    make: *** Deleting file 'vmlinux'

CONFIG_DEBUG_INFO_BTFに設定すると、コンパイル時にエラーが報告されないことがわかりますが、に設定したくnありません。CONFIG_DEBUG_INFO_BTFn

~からこの問題、仮想メモリが小さすぎるようですが、この問題の開始者は仮想マシンを使用しており、私は物理マシンDebian12です。どうすればいいですか?

~/kernel/5.14.2/linux-5.14.2$ free -h
               total        used        free      shared  buff/cache   available
内存:         7.7Gi       508Mi       3.4Gi       1.2Mi       4.1Gi       7.2Gi
交换:         976Mi          0B       976Mi

ベストアンサー1

paholeこれは、1.24以降および「古い」カーネルバージョンを使用しているためです。バラよりhttps://lore.kernel.org/bpf/Ywkq61Lhyf11SsSa@krava/T/#m008baf5c6d4f252dc74cefcd4105295cf08bfd52

つまり、paholeシステムの最新バージョンは生成されたBTF情報を使用しますBTF_KIND_ENUM64が、libbpf以前のカーネルバージョンで使用されたバージョンはこのBTFタイプをサポートしません。

paholeバージョン 1.23 にダウングレードするか、paholeビルドで呼び出される場所を見つけて--skip_encoding_btf_enum64フラグを渡すことができます。

後で同様のエラーが発生した場合は、pr_debugツールを呼び出すときに役立つ情報が報告され、resolve_btfids実際に印刷されるようにログレベルを上げると問題を特定するのに役立ちます。

ソースからビルドしてダウングレードする場合は、リポジトリは次のようになります。https://git.kernel.org/pub/scm/devel/pahole/pahole.git/

おすすめ記事