]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
samples/bpf: fix in-source build of samples with clang
authorBrenden Blanco <bblanco@plumgrid.com>
Tue, 12 May 2015 04:25:51 +0000 (21:25 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 May 2015 03:15:25 +0000 (23:15 -0400)
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 <bblanco@plumgrid.com>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
samples/bpf/Makefile

index 76e3458a5419a556b1b21ffe68d5e867d435f267..8fdbd73429dd94b5c687acb6230586b38127f826 100644 (file)
@@ -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 $@