[DTrace-devel] [PATCH] bpf/Build: spurious fail of test compile is not detected

eugene.loh at oracle.com eugene.loh at oracle.com
Wed Oct 14 13:10:11 PDT 2020


From: Eugene Loh <eugene.loh at oracle.com>

In bpf/Build, the bpf-check target checks for an old version of the BPF cross
compiler.  There are two problems:

- The rule is executed before some essential links are set up.  Therefore,
  the compile always fails, emitting the error message:

    bpf/get_bvar.c:5:10: fatal error: linux/bpf.h: No such file or directory
     #include <linux/bpf.h>
              ^~~~~~~~~~~~~
    compilation terminated.

- Because no assembly output is generated, the check never sees an error.

The first problem can be solved by introducing a dependency in the make rules
such that the links will be created before the bpf-check rule is executed.

The second problem is not that important since, if there truly is a compilation
problem, the actual compilation of the file in question will error out.

Orabug: 32016090
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
 bpf/Build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bpf/Build b/bpf/Build
index ee41f221..bd7683e0 100644
--- a/bpf/Build
+++ b/bpf/Build
@@ -27,7 +27,7 @@ bpf_dlib_SOURCES = \
 	get_tvar.c set_tvar.c \
 	memcpy.c strnlen.c
 
-bpf-check:
+bpf-check: $(objdir)/include/.dir.stamp
 	$(BPFC) $(BPFCPPFLAGS) $(bpf_dlib_CPPFLAGS) $(BPFCFLAGS) -S \
 		-o - bpf/get_bvar.c | \
 		awk '/dt_get_bvar:/ { \
-- 
2.18.4




More information about the DTrace-devel mailing list