foss-for-synopsys-dwc-arc-processors / linux

Helpful resources for users & developers of Linux kernel for ARC
22 stars 13 forks source link

ARC: BTF generation failure: no support for complex types #87

Open geomatsi opened 2 years ago

geomatsi commented 2 years ago

Kernel build fails when CONFIG_DEBUG_INFO_BTF configuration option is enabled:

$ ARCH=arc CROSS_COMPILE=arc32-linux- make loader
  ...
  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
Complex, interval and imaginary float types are not supported: 3
Encountered error while encoding BTF.
  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'

This issue can be reproduced for ARCv2 and ARCv3 (32bit and 64bit). Version of pahole tool:

$ pahole --version
v1.23

Temporary workaround is available: see https://github.com/foss-for-synopsys-dwc-arc-processors/linux/pull/85/commits/b3f0ecc3df0d61265cb4550397fe922754d0f546.

The root cause is in Dwarf complex/float types available in libgcc object files in ARC toolchains. It looks like proper fix should belong to pahole tool. To be more specific, complex Dwarf types should be handled along the same lines as float types are now handled: see pahole commit.