]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitc72851ef1e00f9850f3518ca68e4805670815764
tree45e037f47a7bdc56f5e452c9c1c59d42784334e2
parenta7b0aba26a6fff33d2cc1d98424e3baa4d43258a
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