[DTrace-devel] [PATCH] bpf/Build: spurious fail of test compile is not detected
Kris Van Hees
kris.van.hees at oracle.com
Wed Oct 14 22:28:02 PDT 2020
Thanks for this patch. I already had the same fix queued up on 2.0-branch-dev
for pushing so I added your Signed-off-by and the Orabug to the patch I already
had.
Funny thing is that this problem would only show up when you do a non-SMP
build (which is why I didn't see it earlier).
On Wed, Oct 14, 2020 at 04:10:11PM -0400, eugene.loh at oracle.com wrote:
> 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
>
>
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel
More information about the DTrace-devel
mailing list