提交 876e88e3 编写于 作者: J Joel Fernandes 提交者: David S. Miller

samples/bpf: Enable cross compiler support

When cross compiling, bpf samples use HOSTCC for compiling the non-BPF part of
the sample, however what we really want is to use the cross compiler to build
for the cross target since that is what will load and run the BPF sample.
Detect this and compile samples correctly.
Acked-by: NAlexei Starovoitov <ast@kernel.org>
Signed-off-by: NJoel Fernandes <joelaf@google.com>
Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 95ec6696
...@@ -177,6 +177,11 @@ HOSTLOADLIBES_syscall_tp += -lelf ...@@ -177,6 +177,11 @@ HOSTLOADLIBES_syscall_tp += -lelf
LLC ?= llc LLC ?= llc
CLANG ?= clang CLANG ?= clang
# Detect that we're cross compiling and use the cross compiler
ifdef CROSS_COMPILE
HOSTCC = $(CROSS_COMPILE)gcc
endif
# Trick to allow make to be run from this directory # Trick to allow make to be run from this directory
all: all:
$(MAKE) -C ../../ $(CURDIR)/ $(MAKE) -C ../../ $(CURDIR)/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册