Commit a833effa authored by Ivan Khoronzhuk's avatar Ivan Khoronzhuk Committed by Alexei Starovoitov

samples/bpf: Use target CC environment for HDR_PROBE

No need in hacking HOSTCC to be cross-compiler any more, so drop
this trick and use target CC for HDR_PROBE.
Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarAndrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20191011002808.28206-11-ivan.khoronzhuk@linaro.org
parent 10cb3d87
...@@ -205,15 +205,14 @@ BTF_PAHOLE ?= pahole ...@@ -205,15 +205,14 @@ BTF_PAHOLE ?= pahole
# Detect that we're cross compiling and use the cross compiler # Detect that we're cross compiling and use the cross compiler
ifdef CROSS_COMPILE ifdef CROSS_COMPILE
HOSTCC = $(CROSS_COMPILE)gcc
CLANG_ARCH_ARGS = --target=$(notdir $(CROSS_COMPILE:%-=%)) CLANG_ARCH_ARGS = --target=$(notdir $(CROSS_COMPILE:%-=%))
endif endif
# Don't evaluate probes and warnings if we need to run make recursively # Don't evaluate probes and warnings if we need to run make recursively
ifneq ($(src),) ifneq ($(src),)
HDR_PROBE := $(shell printf "\#include <linux/types.h>\n struct list_head { int a; }; int main() { return 0; }" | \ HDR_PROBE := $(shell printf "\#include <linux/types.h>\n struct list_head { int a; }; int main() { return 0; }" | \
$(HOSTCC) $(KBUILD_HOSTCFLAGS) -x c - -o /dev/null 2>/dev/null && \ $(CC) $(TPROGS_CFLAGS) $(TPROGS_LDFLAGS) -x c - \
echo okay) -o /dev/null 2>/dev/null && echo okay)
ifeq ($(HDR_PROBE),) ifeq ($(HDR_PROBE),)
$(warning WARNING: Detected possible issues with include path.) $(warning WARNING: Detected possible issues with include path.)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment