aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2018-01-30 00:23:28 -0500
committerDaniel Borkmann <daniel@iogearbox.net>2018-02-01 05:26:27 -0500
commit62a06994ced17f295fc51ea0815580ee7ccb668d (patch)
tree9777dca2f5f7d21b55f139e0e55ed7824269a936
parente029f541039ff0768960ede62b946bcf4a163dec (diff)
tools/bpf: permit selftests/bpf to be built in a different directory
Fix a couple of issues at tools/testing/selftests/bpf/Makefile so the following command make -C tools/testing/selftests/bpf OUTPUT=/home/yhs/tmp can put the built results into a different directory. Also add the built binary test_tcpbpf_user in the .gitignore file. Fixes: 6882804c916b ("selftests/bpf: add a test for overlapping packet range checks") Fixes: 9d1f15941967 ("bpf: move cgroup_helpers from samples/bpf/ to tools/testing/selftesting/bpf/") Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rw-r--r--tools/testing/selftests/bpf/.gitignore1
-rw-r--r--tools/testing/selftests/bpf/Makefile4
2 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/.gitignore b/tools/testing/selftests/bpf/.gitignore
index 1e09d77f1948..cc15af2e54fe 100644
--- a/tools/testing/selftests/bpf/.gitignore
+++ b/tools/testing/selftests/bpf/.gitignore
@@ -8,5 +8,6 @@ fixdep
8test_align 8test_align
9test_dev_cgroup 9test_dev_cgroup
10test_progs 10test_progs
11test_tcpbpf_user
11test_verifier_log 12test_verifier_log
12feature 13feature
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index bf05bc5e36e5..566d6adc172a 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -27,7 +27,7 @@ TEST_PROGS := test_kmod.sh test_xdp_redirect.sh test_xdp_meta.sh \
27 27
28include ../lib.mk 28include ../lib.mk
29 29
30BPFOBJ := $(OUTPUT)/libbpf.a $(OUTPUT)/cgroup_helpers.c 30BPFOBJ := $(OUTPUT)/libbpf.a cgroup_helpers.c
31 31
32$(TEST_GEN_PROGS): $(BPFOBJ) 32$(TEST_GEN_PROGS): $(BPFOBJ)
33 33
@@ -58,7 +58,7 @@ CLANG_FLAGS = -I. -I./include/uapi -I../../../include/uapi \
58$(OUTPUT)/test_l4lb_noinline.o: CLANG_FLAGS += -fno-inline 58$(OUTPUT)/test_l4lb_noinline.o: CLANG_FLAGS += -fno-inline
59$(OUTPUT)/test_xdp_noinline.o: CLANG_FLAGS += -fno-inline 59$(OUTPUT)/test_xdp_noinline.o: CLANG_FLAGS += -fno-inline
60 60
61%.o: %.c 61$(OUTPUT)/%.o: %.c
62 $(CLANG) $(CLANG_FLAGS) \ 62 $(CLANG) $(CLANG_FLAGS) \
63 -O2 -target bpf -emit-llvm -c $< -o - | \ 63 -O2 -target bpf -emit-llvm -c $< -o - | \
64 $(LLC) -march=bpf -mcpu=$(CPU) -filetype=obj -o $@ 64 $(LLC) -march=bpf -mcpu=$(CPU) -filetype=obj -o $@