Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alexei Starovoitov and committed by
David S. Miller
1c2dd16a 6ead18fb

+3 -2
+2 -2
tools/testing/selftests/bpf/Makefile
··· 34 34 CLANG ?= clang 35 35 36 36 %.o: %.c 37 - $(CLANG) -I../../../include/uapi -I../../../../samples/bpf/ \ 38 - -D__x86_64__ -Wno-compare-distinct-pointer-types \ 37 + $(CLANG) -I. -I../../../include/uapi -I../../../../samples/bpf/ \ 38 + -Wno-compare-distinct-pointer-types \ 39 39 -O2 -target bpf -c $< -o $@
+1
tools/testing/selftests/bpf/gnu/stubs.h
··· 1 + /* dummy .h to trick /usr/include/features.h to work with 'clang -target bpf' */