Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARCv3: BTF generation failure: invalid unit tag type #88

Open
geomatsi opened this issue Apr 15, 2022 · 0 comments
Open

ARCv3: BTF generation failure: invalid unit tag type #88

geomatsi opened this issue Apr 15, 2022 · 0 comments
Assignees

Comments

@geomatsi
Copy link

Kernel build fails for HS6x (ARCv3 64-bit) configuration with enabled CONFIG_DEBUG_INFO_BTF even if workaround from #87 is applied:

$ ARCH=arc CROSS_COMPILE=arc64-buildroot-linux-gnu- make 
  ...
  CC      init/version.o
  AR      init/built-in.a
  LD      vmlinux.o
  MODPOST vmlinux.symvers
  MODINFO modules.builtin.modinfo
  GEN     modules.builtin
  LD      .tmp_vmlinux.btf
  BTF     .btf.vmlinux.bin.o
die__process: DW_TAG_compile_unit, DW_TAG_type_unit, DW_TAG_partial_unit or DW_TAG_skeleton_unit expected got INVALID (0x0)!
pahole: .tmp_vmlinux.btf: Invalid argument
  LD      .tmp_vmlinux.kallsyms1
  KSYMS   .tmp_vmlinux.kallsyms1.S
  AS      .tmp_vmlinux.kallsyms1.S
  LD      .tmp_vmlinux.kallsyms2
  KSYMS   .tmp_vmlinux.kallsyms2.S
  AS      .tmp_vmlinux.kallsyms2.S
  LD      vmlinux
  BTFIDS  vmlinux
FAILED: load BTF from vmlinux: No such file or directory
make: *** [Makefile:1161: vmlinux] Error 255
make: *** Deleting file 'vmlinux'

Quick hack for pahole to workaround the issue and to generate [possibly invalid] BTF in order to try out BPF on HS6x:

diff --git a/dwarf_loader.c b/dwarf_loader.c
index a0d964b..a1f40bf 100644
--- a/dwarf_loader.c
+++ b/dwarf_loader.c
@@ -2552,7 +2552,7 @@ static int die__process(Dwarf_Die *die, struct cu *cu, struct conf_load *conf)
        if (tag != DW_TAG_compile_unit && tag != DW_TAG_type_unit) {
                fprintf(stderr, "%s: DW_TAG_compile_unit, DW_TAG_type_unit, DW_TAG_partial_unit or DW_TAG_skeleton_unit expected got %s (0x%x)!\n",
                        __FUNCTION__, dwarf_tag_name(tag), tag);
-               return -EINVAL;
+               return 0;
        }

        cu->language = attr_numeric(die, DW_AT_language);

Root cause: TBD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants