From: Brenden Blanco Date: Tue, 12 May 2015 04:25:51 +0000 (-0700) Subject: samples/bpf: fix in-source build of samples with clang X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b88c06e36dcb9b4ae285f7821f62d68dc34b25d3;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git samples/bpf: fix in-source build of samples with clang in-source build of 'make samples/bpf/' was incorrectly using default compiler instead of invoking clang/llvm. out-of-source build was ok. Fixes: a80857822b0c ("samples: bpf: trivial eBPF program in C") Signed-off-by: Brenden Blanco Signed-off-by: Alexei Starovoitov Signed-off-by: David S. Miller --- diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 76e3458a5419..8fdbd73429dd 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -44,7 +44,7 @@ HOSTLOADLIBES_tracex4 += -lelf -lrt # point this to your LLVM backend with bpf support LLC=$(srctree)/tools/bpf/llvm/bld/Debug+Asserts/bin/llc -%.o: %.c +$(obj)/%.o: $(src)/%.c clang $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) \ -D__KERNEL__ -Wno-unused-value -Wno-pointer-sign \ -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@