All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] selftests/bpf: get rid of -D__x86_64__
@ 2017-05-03  4:14 Alexei Starovoitov
  2017-05-03 13:52 ` David Miller
  0 siblings, 1 reply; 14+ messages in thread
From: Alexei Starovoitov @ 2017-05-03  4:14 UTC (permalink / raw)
  To: David S . Miller; +Cc: Daniel Borkmann, netdev

-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>
---
 tools/testing/selftests/bpf/Makefile    | 4 ++--
 tools/testing/selftests/bpf/gnu/stubs.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/gnu/stubs.h

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' */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-05-12 15:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-03  4:14 [PATCH net-next] selftests/bpf: get rid of -D__x86_64__ Alexei Starovoitov
2017-05-03 13:52 ` David Miller
2017-05-03 16:06   ` David Miller
2017-05-03 16:54     ` Alexei Starovoitov
2017-05-03 17:35       ` David Miller
2017-05-04  3:30         ` Alexei Starovoitov
2017-05-04 13:37           ` David Miller
2017-05-04 23:34             ` Alexei Starovoitov
2017-05-11 19:02               ` David Miller
2017-05-11 22:58                 ` Alexei Starovoitov
2017-05-12  1:29                   ` David Miller
2017-05-12  5:07                     ` Alexei Starovoitov
2017-05-12 14:46                       ` David Miller
2017-05-12 15:17                         ` Andrew Lunn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.