Skip to contentSkip to conversation

selftests/bpf: restore $(OUTPUT)/test_stub.o rule

PATCH Applied Ilya Leoshkevich 2 participants 2 messages Oct 28, 2019

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

PATCH v2 1/1 selftests/bpf: restore $(OUTPUT)/test_stub.o rule

make O=/linux-build kselftest TARGETS=bpf fails with

make[3]: *** No rule to make target '/linux-build/bpf/test_stub.o', needed by '/linux-build/bpf/test_verifier'

The same command without the O= part works, presumably thanks to the implicit rule.

Fix by restoring the explicit $(OUTPUT)/test_stub.o rule.

Fixes 74b5a5968fe8 ("selftests/bpf: Replace test_progs and test_maps w/ general rule")

---
v1 -> v2: Remove $(CPPFLAGS)

tools/testing/selftests/bpf/Makefile | 3 +++

 1 file changed, 3 insertions(+)
tools/testing/selftests/bpf/Makefile +3 -0
index 3209c208f3b3..b334a6db15c1 100644
@@ -89,6 +89,9 @@ $(notdir $(TEST_GEN_PROGS)						\
 $(OUTPUT)/urandom_read: urandom_read.c
 	$(CC) -o $@ $< -Wl,--build-id
 
+$(OUTPUT)/test_stub.o: test_stub.c
+	$(CC) -c $(CFLAGS) -o $@ $<
+
 BPFOBJ := $(OUTPUT)/libbpf.a
 
 $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED): $(OUTPUT)/test_stub.o $(BPFOBJ)
Signature · 1 line
2.23.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Ilya Leoshkevich

make O=/linux-build kselftest TARGETS=bpf fails with

make[3]: *** No rule to make target '/linux-build/bpf/test_stub.o', needed by '/linux-build/bpf/test_verifier'

Quoted 8 lines

The same command without the O= part works, presumably thanks to the implicit rule.

Fix by restoring the explicit $(OUTPUT)/test_stub.o rule.

Fixes 74b5a5968fe8 ("selftests/bpf: Replace test_progs and test_maps w/ general rule")

Applied, thanks!