From: Joel Fernandes Date: Wed, 20 Sep 2017 16:11:59 +0000 (-0700) Subject: samples/bpf: Add documentation on cross compilation X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8bf2ac25a96c69985a1a9fbbad7da22ae4343a38;p=linux.git samples/bpf: Add documentation on cross compilation Acked-by: Alexei Starovoitov Signed-off-by: Joel Fernandes Acked-by: Daniel Borkmann Signed-off-by: David S. Miller --- diff --git a/samples/bpf/README.rst b/samples/bpf/README.rst index 79f9a58f18727..5f27e4faca50c 100644 --- a/samples/bpf/README.rst +++ b/samples/bpf/README.rst @@ -64,3 +64,13 @@ It is also possible to point make to the newly compiled 'llc' or 'clang' command via redefining LLC or CLANG on the make command line:: make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang + +Cross compiling samples +----------------------- +In order to cross-compile, say for arm64 targets, export CROSS_COMPILE and ARCH +environment variables before calling make. This will direct make to build +samples for the cross target. + +export ARCH=arm64 +export CROSS_COMPILE="aarch64-linux-gnu-" +make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang