Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
bpf: Fix build when CONFIG_BPF_SYSCALL is disabled
When CONFIG_DEBUG_INFO_BTF is enabled and CONFIG_BPF_SYSCALL is disabled, the following compilation error can be seen: GEN .version CHK include/generated/compile.h UPD include/generated/compile.h CC init/version.o AR init/built-in.a LD vmlinux.o MODPOST vmlinux.symvers MODINFO modules.builtin.modinfo GEN modules.builtin LD .tmp_vmlinux.btf ld: net/ipv4/tcp_cubic.o: in function `cubictcp_unregister': net/ipv4/tcp_cubic.c:545: undefined reference to `bpf_tcp_ca_kfunc_list' ld: net/ipv4/tcp_cubic.c:545: undefined reference to `unregister_kfunc_btf_id_set' ld: net/ipv4/tcp_cubic.o: in function `cubictcp_register': net/ipv4/tcp_cubic.c:539: undefined reference to `bpf_tcp_ca_kfunc_list' ld: net/ipv4/tcp_cubic.c:539: undefined reference to `register_kfunc_btf_id_set' BTF .btf.vmlinux.bin.o pahole: .tmp_vmlinux.btf: No such file or directory LD .tmp_vmlinux.kallsyms1 .btf.vmlinux.bin.o: file not recognized: file format not recognized make: *** [Makefile:1187: vmlinux] Error 1 'bpf_tcp_ca_kfunc_list', 'register_kfunc_btf_id_set()' and 'unregister_kfunc_btf_id_set()' are only defined when CONFIG_BPF_SYSCALL is enabled. Fix that by moving those definitions somewhere that doesn't depend on the bpf() syscall. Fixes: 14f267d ("bpf: btf: Introduce helpers for dynamic BTF set registration") Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
- Loading branch information