Commit 493e215a authored by Joanne Hugé's avatar Joanne Hugé

Compile xdp kern with clang as a BPF target

parent 84e35f5b
......@@ -6,7 +6,6 @@ SERVER_SRCS = server.c
SERVER_SRCS += recv_packet.c
SERVER_SRCS += send_packet.c
SERVER_SRCS += utilities.c
SERVER_SRCS += xdp_kern.c
CLIENT_SRCS = client.c
CLIENT_SRCS += recv_packet.c
......@@ -36,8 +35,17 @@ endif
vpath %.c $(SRCDIR)
xdp_kern.o:
clang -S -target bpf -D __BPF_TRACING__ -Wall -O2 -emit-llvm -c -g -o xdp_kern.ll xdp_kern.c
llc -march=bpf -filetype=obj -o xdp_kern.o xdp_kern.ll
ifneq ($(WITH_XDP),)
$(SERVER_PROG): $(SERVER_OBJS)
$(CC) $(LDFLAGS) $(LDIRS) $^ $(LLIBS) -o $@
else
$(SERVER_PROG): $(SERVER_OBJS), xdp_kern.o
$(CC) $(LDFLAGS) $(LDIRS) $^ $(LLIBS) -o $@
endif
$(CLIENT_PROG): $(CLIENT_OBJS)
$(CC) $(LDFLAGS) $(LDIRS) $^ $(LLIBS) -o $@
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment