google / ghost-userspace

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: failed to open BPF object file: Relocation failed

NGUETOUM opened this issue · comments

Good Morning,
I've compiled the kernel and replaced my previous kernel in my ubuntu, then when using the command sudo bazel build -c opt ... to compile ghost-userspace, I got this error:

ERROR: /home/armel/Desktop/ghost/ghost-userspace/BUILD:455:13: Executing genrule //:schedghostidle_bpf_skel failed: (Exit 255): bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
libbpf: prog 'sched_ghost_latched': invalid relo against 'nr_latches' in special section 0xfff2; forgot to initialize global var?..
Error: failed to open BPF object file: Relocation failed
INFO: Elapsed time: 192.466s, Critical Path: 3.28s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully

The version of ghost-kernel that I am using is 5.11.0+ and i am using Ubuntu 20.04.
Please someone can help me to solve this problem ?

Good Morning,
I am very sorry to disturb you but I have found the solution to my problem. To solve that issue I have just initialize some variable in
the following file : third_party/bpf/schedghostidle.bpf.c.
In that file I have just initialize the following variable:
uint64_t nr_latches = 0;
uint64_t nr_bpf_latches = 0;
uint64_t nr_idle_to_bpf_latches = 0;

Excuse me and thanks for your comprehension.

Fixed in #7.