summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@fb.com>2017-05-03 06:14:43 +0200
committerDavid S. Miller <davem@davemloft.net>2017-05-03 15:51:25 +0200
commit1c2dd16add7ebd7fc6a47f21a42f502cfed5ec2f (patch)
treea9efec88cd7ddbf718c46c8a279d8f72101b0eca
parentselftests/bpf: add a test case to check verifier pointer arithmetic (diff)
downloadlinux-1c2dd16add7ebd7fc6a47f21a42f502cfed5ec2f.tar.xz
linux-1c2dd16add7ebd7fc6a47f21a42f502cfed5ec2f.zip
selftests/bpf: get rid of -D__x86_64__
-D__x86_64__ workaround was used to make /usr/include/features.h to follow expected path through the system include headers. This is not portable. Instead define dummy stubs.h which is used by 'clang -target bpf' Fixes: 6882804c916b ("selftests/bpf: add a test for overlapping packet range checks") Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--tools/testing/selftests/bpf/Makefile4
-rw-r--r--tools/testing/selftests/bpf/gnu/stubs.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index f4341e160de6..91edd0566237 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -34,6 +34,6 @@ $(BPFOBJ): force
CLANG ?= clang
%.o: %.c
- $(CLANG) -I../../../include/uapi -I../../../../samples/bpf/ \
- -D__x86_64__ -Wno-compare-distinct-pointer-types \
+ $(CLANG) -I. -I../../../include/uapi -I../../../../samples/bpf/ \
+ -Wno-compare-distinct-pointer-types \
-O2 -target bpf -c $< -o $@
diff --git a/tools/testing/selftests/bpf/gnu/stubs.h b/tools/testing/selftests/bpf/gnu/stubs.h
new file mode 100644
index 000000000000..719225b16626
--- /dev/null
+++ b/tools/testing/selftests/bpf/gnu/stubs.h
@@ -0,0 +1 @@
+/* dummy .h to trick /usr/include/features.h to work with 'clang -target bpf' */