I'm new to XDP, I am trying to compile a simple code to start with. When I compile with clang, I face an error. Can someone please help me out in resolving this issue.
# clang -target bpf -c drop.c -o drop.o error: unknown target triple 'bpf', please use -triple or -arch
Which version of clang are you using? It looks like it is missing the bpf target.
Built the kernel with the following flags on: CONFIG_CGROUP_BPF=y CONFIG_BPF=y CONFIG_BPF_SYSCALL=y CONFIG_BPF_JIT_ALWAYS_ON=y CONFIG_NETFILTER_XT_MATCH_BPF=m CONFIG_BPFILTER=y CONFIG_BPFILTER_UMH=m CONFIG_NET_CLS_BPF=m CONFIG_NET_ACT_BPF=m CONFIG_BPF_JIT=y CONFIG_BPF_STREAM_PARSER=y CONFIG_LWTUNNEL_BPF=y CONFIG_HAVE_EBPF_JIT=y CONFIG_BPF_EVENTS=y CONFIG_BPF_KPROBE_OVERRIDE=y CONFIG_TEST_BPF=m