Skip to contentSkip to conversation

samples/bpf: fix in-source build of samples with clang

PATCH Applied Alexei Starovoitov 2 participants 2 messages May 12, 2015 – May 13, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 samples/bpf: fix in-source build of samples with clang

From: Brenden Blanco <[email protected]>

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")

---
It's a minor fix and not strictly necessary for stable.

 samples/bpf/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
samples/bpf/Makefile +1 -1
index 76e3458a5419..8fdbd73429dd 100644
@@ -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 $@
Signature · 1 line
1.7.9.5
maintainer Applied
#1 lore raw

From: Alexei Starovoitov <[email protected]>
Date: Mon, 11 May 2015 21:25:51 -0700

Quoted 9 lines

From: Brenden Blanco <[email protected]>

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")

Applied.