Skip to contentSkip to conversation

selftests net: fix bpf build error

PATCH Superseded Lina Wang 3 participants 4 messages Jun 1, 2022 – Jun 6, 2022

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Lina Wang

author
#0 lore raw

PATCH v2 1/1 selftests net: fix bpf build error

bpf_helpers.h has been moved to tools/lib/bpf since 5.10, so add more including path.

Fixes edae34a3ed92 ("selftests net: add UDP GRO fraglist + bpf self-tests")
---
 tools/testing/selftests/net/bpf/Makefile | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/net/bpf/Makefile +1 -0
index f91bf14bbee7..070251986dbe 100644
@@ -2,6 +2,7 @@
 
 CLANG ?= clang
 CCINCLUDE += -I../../bpf
+CCINCLUDE += -I../../../../lib
 CCINCLUDE += -I../../../../../usr/include/
 
 TEST_CUSTOM_PROGS = $(OUTPUT)/bpf/nat6to4.o
Signature · 1 line
2.18.0
maintainer
#2 lore raw
In reply to Lina Wang
Quoted 15 lines · Lina Wang

bpf_helpers.h has been moved to tools/lib/bpf since 5.10, so add more including path.

Fixes edae34a3ed92 ("selftests net: add UDP GRO fraglist + bpf self-tests")
---
 tools/testing/selftests/net/bpf/Makefile | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/net/bpf/Makefile +0 -0
index f91bf14bbee7..070251986dbe 100644

tools/testing/selftests/net/bpf/Makefile line 8

Quoted 7 lines
tools/testing/selftests/net/bpf/Makefile +1 -0
@@ -2,6 +2,7 @@
 
 CLANG ?= clang
 CCINCLUDE += -I../../bpf
+CCINCLUDE += -I../../../../lib
 CCINCLUDE += -I../../../../../usr/include/
 
 TEST_CUSTOM_PROGS = $(OUTPUT)/bpf/nat6to4.o

With this patch applied, I still get an error while building the self- tests:

---
cd tools/testing/selftests/
make
#...
make[1]: Entering directory '/home/pabeni/net/tools/testing/selftests/net'
bpf/Makefile:15: warning: overriding recipe for target 'clean'
../lib.mk:136: warning: ignoring old recipe for target 'clean'
clang -O2 -target bpf -c bpf/nat6to4.c -I../../bpf -I../../../../lib -I../../../../../usr/include/ -o /home/pabeni/net/tools/testing/selftests/net/bpf/nat6to4.o bpf/nat6to4.c:43:10: fatal error: 'bpf/bpf_helpers.h' file not found

#include <bpf/bpf_helpers.h>
         ^~~~~~~~~~~~~~~~~~~

1 error generated.
make[1]: *** [bpf/Makefile:12: /home/pabeni/net/tools/testing/selftests/net/bpf/nat6to4.o] Error 1
---

the following fix the issue here:

---

tools/testing/selftests/net/bpf/Makefile +1 -2
index 070251986dbe..cff99d571408 100644
@@ -2,7 +2,7 @@
 
 CLANG ?= clang
 CCINCLUDE += -I../../bpf
-CCINCLUDE += -I../../../../lib
+CCINCLUDE += -I../../../lib
 CCINCLUDE += -I../../../../../usr/include/
---
 

(But I still hit the "overriding recipe for target 'clean'" warnings)

Cheers,

Paolo

author
#3 lore raw

tools/testing/selftests/net/bpf/Makefile line 7

Quoted 12 lines · Paolo Abeni
Quoted 5 lines · Lina Wang

bpf_helpers.h has been moved to tools/lib/bpf since 5.10, so add more
including path.

Fixes edae34a3ed92 ("selftests net: add UDP GRO fraglist + bpf

CLANG ?= clang
CCINCLUDE += -I../../bpf

tools/testing/selftests/net/bpf/Makefile +1 -2
-CCINCLUDE += -I../../../../lib
+CCINCLUDE += -I../../../lib
 CCINCLUDE += -I../../../../../usr/include/
---

Your solution is right,

Quoted 1 line

(But I still hit the "overriding recipe for target 'clean'" warnings)

I have fixed in v3, the warning is that tools/testing/selftests/net/bpf/Makefile has redefined "clean"

Thanks!