[PATCH bpf-next 1/3] samples/bpf: Fix building out of srctree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Building BPF samples out of srctree fails, because the output directory
for progs shared with selftests (CGROUP_HELPERS, TRACE_HELPERS) is
missing and the compiler cannot create output files.

Fix by creating the output directory in Makefile.

Signed-off-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>
---
 samples/bpf/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index f87ee02073ba..81ba0beca0a3 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -301,6 +301,7 @@ $(obj)/hbm_edt_kern.o: $(src)/hbm.h $(src)/hbm_kern.h
 # But, there is no easy way to fix it, so just exclude it since it is
 # useless for BPF samples.
 $(obj)/%.o: $(src)/%.c
+	$(Q)mkdir -p $(@D)
 	@echo "  CLANG-bpf " $@
 	$(Q)$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(BPF_EXTRA_CFLAGS) \
 		-I$(obj) -I$(srctree)/tools/testing/selftests/bpf/ \
-- 
2.25.4




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux