Redefinition of function pointers from bpf_helpers.h
Swire42 opened this issue · 3 comments
Swire42 commented
Hi,
It seems that the current version of ghost-userspace fails to build with the current ghost-kernel.
bazel build ...
results in :
In file included from third_party/bpf/schedlat.bpf.c:21:
./third_party/bpf/common.bpf.h:32:15: error: redefinition of 'bpf_ghost_wake_agent'
static long (*bpf_ghost_wake_agent)(__u32 cpu) = (void *) 3000;
^
bazel-out/k8-fastbuild/bin/external/linux/libbpf/include/libbpf/bpf_helper_defs.h:3743:15: note: previous definition is here
static long (*bpf_ghost_wake_agent)(__u32 cpu) = (void *) 3000;
^
In file included from third_party/bpf/schedlat.bpf.c:21:
./third_party/bpf/common.bpf.h:33:15: error: redefinition of 'bpf_ghost_run_gtid'
static long (*bpf_ghost_run_gtid)(__s64 gtid, __u32 task_barrier, __s32 run_flags) = (void *) 3001;
^
bazel-out/k8-fastbuild/bin/external/linux/libbpf/include/libbpf/bpf_helper_defs.h:3754:15: note: previous definition is here
static long (*bpf_ghost_run_gtid)(__s64 gtid, __u32 task_barrier, __s32 run_flags) = (void *) 3001;
^
In file included from third_party/bpf/schedlat.bpf.c:21:
./third_party/bpf/common.bpf.h:34:15: error: redefinition of 'bpf_ghost_resched_cpu'
static long (*bpf_ghost_resched_cpu)(__u32 cpu, __u64 cpu_seqnum) = (void *) 3002;
^
bazel-out/k8-fastbuild/bin/external/linux/libbpf/include/libbpf/bpf_helper_defs.h:3767:15: note: previous definition is here
static long (*bpf_ghost_resched_cpu)(__u32 cpu, __u64 cpu_seqnum) = (void *) 3002;
^
3 errors generated.
Commenting these 3 lines in ./third_party/bpf/common.bpf.h fixes the issue and the build succeeds.
I believe the best solution would be to guard this 3 lines with a preprocessor condition.
jackhumphries commented
Hi,
Thanks for bringing this issue to our attention. Our open source maintainer is on vacation, so we will hopefully have this fixed early next week.
jackhumphries commented
Hi all,
We just pushed a commit to fix this issue. We also made a change to one of this repo's dependencies, so if you still see the issue, you may need to tell Bazel to pull the latest updates for the dependencies.