samples/bpf: Fix pt_regs issues when cross-compiling
authorJoel Fernandes <joelaf@google.com>
Wed, 20 Sep 2017 16:11:58 +0000 (09:11 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Sep 2017 18:59:16 +0000 (11:59 -0700)
commitb655fc1c2ee1c2b2d07c0b6f432798b91202718c
tree45e037f47a7bdc56f5e452c9c1c59d42784334e2
parent876e88e3273e300895e308bd660c6cfaabb03cd5
samples/bpf: Fix pt_regs issues when cross-compiling

BPF samples fail to build when cross-compiling for ARM64 because of incorrect
pt_regs param selection. This is because clang defines __x86_64__ and
bpf_headers thinks we're building for x86. Since clang is building for the BPF
target, it shouldn't make assumptions about what target the BPF program is
going to run on. To fix this, lets pass ARCH so the header knows which target
the BPF program is being compiled for and can use the correct pt_regs code.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Joel Fernandes <joelaf@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
samples/bpf/Makefile
tools/testing/selftests/bpf/bpf_helpers.h