From 2c8602eb54937903f7d738ccb11f2cfe81f8c780 Mon Sep 17 00:00:00 2001 From: Andrii Nakryiko Date: Thu, 9 Jan 2020 21:17:15 -0800 Subject: [PATCH] selftests/bpf: Ensure bpf_helper_defs.h are taken from selftests dir Reorder includes search path to ensure $(OUTPUT) and $(CURDIR) go before libbpf's directory. Also fix bpf_helpers.h to include bpf_helper_defs.h in such a way as to leverage includes search path. This allows selftests to not use libbpf's local and potentially stale bpf_helper_defs.h. It's important because selftests/bpf's Makefile only re-generates bpf_helper_defs.h in seltests' output directory, not the one in libbpf's directory. Also force regeneration of bpf_helper_defs.h when libbpf.a is updated to reduce staleness. Fixes: fa633a0f8919 ("libbpf: Fix build on read-only filesystems") Reported-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20200110051716.1591485-3-andriin@fb.com --- src/bpf_helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bpf_helpers.h b/src/bpf_helpers.h index f69cc20..050bb7b 100644 --- a/src/bpf_helpers.h +++ b/src/bpf_helpers.h @@ -2,7 +2,7 @@ #ifndef __BPF_HELPERS__ #define __BPF_HELPERS__ -#include "bpf_helper_defs.h" +#include #define __uint(name, val) int (*name)[val] #define __type(name, val) typeof(val) *name