cloudflare-blog icon indicating copy to clipboard operation
cloudflare-blog copied to clipboard

Build fails for echo-sockmap target

Open salieri11 opened this issue 5 years ago • 1 comments

Hi I am trying to build echo-sockmap target and it fails since echo-sockmap-ebpf.c is not in the repo (it is in the .gitignore and probably was not pushed) If I try to remove this file from Makefile I get

2019-02-tcp-splice/echo-sockmap.c:43: undefined reference to bpf_reloc_prog_verdict' 2019-02-tcp-splice/echo-sockmap.c:43: undefined reference to bpf_insn_prog_verdict' 2019-02-tcp-splice/echo-sockmap.c:48: undefined reference to bpf_insn_prog_parser_cnt' 2019-02-tcp-splice/echo-sockmap.c:48: undefined reference to bpf_insn_prog_parser' 2019-02-tcp-splice/echo-sockmap.c:57: undefined reference to bpf_insn_prog_verdict_cnt' 2019-02-tcp-splice/echo-sockmap.c:57: undefined reference to bpf_insn_prog_verdict'

Please advise. Thanks!

salieri11 avatar Jan 15 '20 17:01 salieri11

Hi @salieri11 ,

echo-sockmap-bpf.c file gets generated when building the project with the following command found in Makefile

        clang -Wall -Wextra -O2 -emit-llvm -c \
                echo-sockmap-kern.c \
                -S -o - \
                | llc -march=bpf -filetype=obj -o - \
                | ./venv/bin/python3 tbpf-decode-elf.py /dev/stdin \
                        prog_parser prog_verdict \
                > echo-sockmap-ebpf.c

Try running it manually to see if any of the commands fails and shows any errors.

jsitnicki avatar Mar 03 '20 10:03 jsitnicki