0

When building the 5.18 kernel from the Linus Torvalds git for arch linux, several similar warnings appear and the build ends with an error:

`MODINFO modules.builtin.modinfo
 GEN     modules.builtin
 LD      .tmp_vmlinux.btf
 ld: warning: .tmp_vmlinux.btf has a LOAD segment with RWX permissions
 BTF     .btf.vmlinux.bin.o
 LD      .tmp_vmlinux.kallsyms1
 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: .tmp_vmlinux.kallsyms2 has a LOAD segment with RWX permissions
 KSYMS   .tmp_vmlinux.kallsyms2.S
 AS      .tmp_vmlinux.kallsyms2.S
 LD      vmlinux
 ld: warning: vmlinux has a LOAD segment with RWX permissions
 BTFIDS  vmlinux
 FAILED: load BTF from vmlinux: Invalid argument
 make: *** [Makefile:1158: vmlinux] Error 255
 make: *** Deleting file 'vmlinux'`

Has anyone encountered this or can suggest possible solutions? All the necessary dependencies from wiki have been installed

I built the kernel according to the instructions from the arch linux wiki https://wiki.archlinux.org/title/Kernel/Traditional_compilation

AndreyRz
  • 9
  • 3

1 Answers1

0

Had the same problem while building 5.15.13. Apparently an older kernel requires an older pahole to get successfully linked. In my case I had distro provided 1:1.24+r29+g02d67c5-1 version that I downgraded to 1:1.23-1.

Note: the warnings didn't go away, but build completed successfully.

[…]
  MODINFO modules.builtin.modinfo
  GEN     modules.builtin
  LD      .tmp_vmlinux.btf
ld: warning: .tmp_vmlinux.btf has a LOAD segment with RWX permissions
  BTF     .btf.vmlinux.bin.o
  LD      .tmp_vmlinux.kallsyms1
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: .tmp_vmlinux.kallsyms2 has a LOAD segment with RWX permissions
  KSYMS   .tmp_vmlinux.kallsyms2.S
  AS      .tmp_vmlinux.kallsyms2.S
  LD      vmlinux
ld: warning: vmlinux has a LOAD segment with RWX permissions
  BTFIDS  vmlinux
  SORTTAB vmlinux
  SYSMAP  System.map
  HOSTCC  arch/x86/tools/insn_decoder_test
  HOSTCC  arch/x86/tools/insn_sanity
  MODPOST modules-only.symvers
  TEST    posttest
  GEN     Module.symvers
[…]

Credits go to this post. But worth noting that in that topic OP simply replaced some scripts under scripts/ dir, however in my case I didn't have those. Instead I specifically downgraded pahole.

Hi-Angel
  • 4,933
  • 8
  • 63
  • 86