selftests/bpf: compile progs with -D__TARGET_ARCH_$(SRCARCH)
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 11 Jul 2019 14:29:27 +0000 (16:29 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 12 Jul 2019 13:38:04 +0000 (15:38 +0200)
This opens up the possibility of accessing registers in an
arch-independent way.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/Makefile

index 8312db1..277d860 100644 (file)
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 include ../../../../scripts/Kbuild.include
+include ../../../scripts/Makefile.arch
 
 LIBDIR := ../../../lib
 BPFDIR := $(LIBDIR)/bpf
@@ -139,7 +140,8 @@ CLANG_SYS_INCLUDES := $(shell $(CLANG) -v -E - </dev/null 2>&1 \
 
 CLANG_FLAGS = -I. -I./include/uapi -I../../../include/uapi \
              $(CLANG_SYS_INCLUDES) \
-             -Wno-compare-distinct-pointer-types
+             -Wno-compare-distinct-pointer-types \
+             -D__TARGET_ARCH_$(SRCARCH)
 
 $(OUTPUT)/test_l4lb_noinline.o: CLANG_FLAGS += -fno-inline
 $(OUTPUT)/test_xdp_noinline.o: CLANG_FLAGS += -fno-inline