You are not logged in.

#1 2023-10-20 00:07:46

linuxsimpleton43
Member
Registered: 2022-03-24
Posts: 33

Compiling Kernel with Clang and using PGO

So I've been reading about PGO with GCC on the linux kernel and I was wondering if PGO is possible when building the kernel with clang. Its been implemented in the android kernel and I found this github which also implements it with a patch (https://github.com/h0tc0d3/linux_pgo). I tried using the same patch with the latest kernel (clang 16.06) but towards the end of the build I get LD errors. Is it possible to fix these errors or should I just try to find a different way to do this?

Errors:

vmlinux.o: warning: objtool: __llvm_prf_data+0x18: data relocation to !ENDBR: ibt_save+0x0
vmlinux.o: warning: objtool: __llvm_prf_data+0x18: data relocation to !ENDBR: ibt_restore+0x0
vmlinux.o: warning: objtool: __llvm_prf_data+0x18: data relocation to !ENDBR: cet_disable+0x0
OBJCOPY modules.builtin.modinfo
GEN     modules.builtin
MODPOST Module.symvers
CC      .vmlinux.export.o
 UPD     include/generated/utsversion.h
CC      init/version-timestamp.o
LD      .tmp_vmlinux.btf
ld.lld: error: duplicate symbol: __llvm_profile_raw_version
>>> defined at usercopy_64.c
>>>           vmlinux.o:(__llvm_profile_raw_version)
>>> defined at .vmlinux.export.c
>>>           .vmlinux.export.o:(.rodata.__llvm_profile_raw_version+0x0)
 BTF     .btf.vmlinux.bin.o
pahole: .tmp_vmlinux.btf: Invalid argument
LD      .tmp_vmlinux.kallsyms1
ld.lld: error: .btf.vmlinux.bin.o: unknown file type

Offline

Board footer

Powered by FluxBB