[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221114203431.302655-1-andrea.righi@canonical.com>
Date: Mon, 14 Nov 2022 21:34:31 +0100
From: Andrea Righi <andrea.righi@...onical.com>
To: Shuah Khan <shuah@...nel.org>
Cc: Paolo Abeni <pabeni@...hat.com>,
Coleman Dietsch <dietschc@....edu>,
Lina Wang <lina.wang@...iatek.com>,
Kamal Mostafa <kamal@...onical.com>,
linux-kselftest@...r.kernel.org, netdev@...r.kernel.org,
bpf@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] selftests net: additional fix for kselftest net build error
We need to make sure that bpf_helpers.h is properly generated when
building the net kselftest, otherwise we get this build error:
$ make -C tools/testing/selftests/net
...
bpf/nat6to4.c:43:10: fatal error: 'bpf/bpf_helpers.h' file not found
^~~~~~~~~~~~~~~~~~~
1 error generated.
Fix by adding a make dependency on tools/lib/bpf/bpf_helper_defs.h.
Moreover, re-add the include that was initially added by commit
cf67838c4422 ("selftests net: fix bpf build error"), otherwise we won't
be able to properly include bpf_helpers.h.
Fixes: 7b92aa9e6135 ("selftests net: fix kselftest net fatal error")
Signed-off-by: Andrea Righi <andrea.righi@...onical.com>
---
tools/testing/selftests/net/bpf/Makefile | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/bpf/Makefile b/tools/testing/selftests/net/bpf/Makefile
index 8ccaf8732eb2..cc6579e154eb 100644
--- a/tools/testing/selftests/net/bpf/Makefile
+++ b/tools/testing/selftests/net/bpf/Makefile
@@ -2,11 +2,15 @@
CLANG ?= clang
CCINCLUDE += -I../../bpf
+CCINCLUDE += -I../../../lib
CCINCLUDE += -I../../../../lib
CCINCLUDE += -I../../../../../usr/include/
+bpf_helper_defs.h:
+ @make OUTPUT=./ -C $(OUTPUT)/../../../../tools/lib/bpf bpf_helper_defs.h
+
TEST_CUSTOM_PROGS = $(OUTPUT)/bpf/nat6to4.o
-all: $(TEST_CUSTOM_PROGS)
+all: bpf_helper_defs.h $(TEST_CUSTOM_PROGS)
$(OUTPUT)/%.o: %.c
$(CLANG) -O2 -target bpf -c $< $(CCINCLUDE) -o $@
--
2.37.2
Powered by blists - more mailing lists