Skip to content

Commit

Permalink
selftests/bpf: get rid of -D__x86_64__
Browse files Browse the repository at this point in the history
-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: 6882804 ("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>
  • Loading branch information
Alexei Starovoitov authored and David S. Miller committed May 3, 2017
1 parent 6ead18f commit 1c2dd16
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/bpf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@
1 change: 1 addition & 0 deletions tools/testing/selftests/bpf/gnu/stubs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* dummy .h to trick /usr/include/features.h to work with 'clang -target bpf' */

0 comments on commit 1c2dd16

Please sign in to comment.