]> 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)
commit9e2cb607beab3f32979e0bd7734b05f2327a75d4
tree45e037f47a7bdc56f5e452c9c1c59d42784334e2
parentcba3ba4daf45b9aa7a8654011a1a10b90297b692
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