selftests/bpf: get rid of -D__x86_64__
authorAlexei Starovoitov <ast@fb.com>
Wed, 3 May 2017 04:14:43 +0000 (21:14 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 May 2017 13:51:25 +0000 (09:51 -0400)
-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>
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/gnu/stubs.h [new file with mode: 0644]

index f4341e160de6e4580deadc129f4c84d2172fe4d3..91edd056623789fb5585bd774b6d98eb5dba1cc2 100644 (file)
@@ -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 (file)
index 0000000..719225b
--- /dev/null
@@ -0,0 +1 @@
+/* dummy .h to trick /usr/include/features.h to work with 'clang -target bpf' */