samples/bpf: Add preparation steps and sysroot info to readme
Add couple preparation steps: clean and configuration. Also add newly added sysroot support info to cross-compile section. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20191011002808.28206-16-ivan.khoronzhuk@linaro.org
This commit is contained in:
Родитель
b2327c107d
Коммит
1600c9c26f
|
@ -14,6 +14,20 @@ Compiling requires having installed:
|
||||||
Note that LLVM's tool 'llc' must support target 'bpf', list version
|
Note that LLVM's tool 'llc' must support target 'bpf', list version
|
||||||
and supported targets with command: ``llc --version``
|
and supported targets with command: ``llc --version``
|
||||||
|
|
||||||
|
Clean and configuration
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
It can be needed to clean tools, samples or kernel before trying new arch or
|
||||||
|
after some changes (on demand)::
|
||||||
|
|
||||||
|
make -C tools clean
|
||||||
|
make -C samples/bpf clean
|
||||||
|
make clean
|
||||||
|
|
||||||
|
Configure kernel, defconfig for instance::
|
||||||
|
|
||||||
|
make defconfig
|
||||||
|
|
||||||
Kernel headers
|
Kernel headers
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
@ -68,9 +82,26 @@ It is also possible to point make to the newly compiled 'llc' or
|
||||||
Cross compiling samples
|
Cross compiling samples
|
||||||
-----------------------
|
-----------------------
|
||||||
In order to cross-compile, say for arm64 targets, export CROSS_COMPILE and ARCH
|
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
|
environment variables before calling make. But do this before clean,
|
||||||
samples for the cross target.
|
cofiguration and header install steps described above. This will direct make to
|
||||||
|
build samples for the cross target::
|
||||||
|
|
||||||
export ARCH=arm64
|
export ARCH=arm64
|
||||||
export CROSS_COMPILE="aarch64-linux-gnu-"
|
export CROSS_COMPILE="aarch64-linux-gnu-"
|
||||||
make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang
|
|
||||||
|
Headers can be also installed on RFS of target board if need to keep them in
|
||||||
|
sync (not necessarily and it creates a local "usr/include" directory also)::
|
||||||
|
|
||||||
|
make INSTALL_HDR_PATH=~/some_sysroot/usr headers_install
|
||||||
|
|
||||||
|
Pointing LLC and CLANG is not necessarily if it's installed on HOST and have
|
||||||
|
in its targets appropriate arm64 arch (usually it has several arches).
|
||||||
|
Build samples::
|
||||||
|
|
||||||
|
make samples/bpf/
|
||||||
|
|
||||||
|
Or build samples with SYSROOT if some header or library is absent in toolchain,
|
||||||
|
say libelf, providing address to file system containing headers and libs,
|
||||||
|
can be RFS of target board::
|
||||||
|
|
||||||
|
make samples/bpf/ SYSROOT=~/some_sysroot
|
||||||
|
|
Загрузка…
Ссылка в новой задаче