[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bed6c51c-9a96-5957-7cd2-38f541e1dd6e@isovalent.com>
Date: Thu, 12 Mar 2020 12:34:40 +0000
From: Quentin Monnet <quentin@...valent.com>
To: Song Liu <songliubraving@...com>, netdev@...r.kernel.org,
bpf@...r.kernel.org
Cc: john.fastabend@...il.com, kernel-team@...com, ast@...nel.org,
daniel@...earbox.net, arnaldo.melo@...il.com, jolsa@...nel.org
Subject: Re: [PATCH v2 bpf-next 2/3] bpftool: skeleton should depend on libbpf
2020-03-12 11:46 UTC+0000 ~ Quentin Monnet <quentin@...valent.com>
> 2020-03-11 15:18 UTC-0700 ~ Song Liu <songliubraving@...com>
>> Add the dependency to libbpf, to fix build errors like:
>>
>> In file included from skeleton/profiler.bpf.c:5:
>> .../bpf_helpers.h:5:10: fatal error: 'bpf_helper_defs.h' file not found
>> #include "bpf_helper_defs.h"
>> ^~~~~~~~~~~~~~~~~~~
>> 1 error generated.
>> make: *** [skeleton/profiler.bpf.o] Error 1
>> make: *** Waiting for unfinished jobs....
>>
>> Fixes: 47c09d6a9f67 ("bpftool: Introduce "prog profile" command")
>> Acked-by: John Fastabend <john.fastabend@...il.com>
>> Signed-off-by: Song Liu <songliubraving@...com>
>
> Reviewed-by: Quentin Monnet <quentin@...valent.com>
>
Sorry, I gave the tag too fast. This one is not solved on my machine,
I still observe the same error when building out of tree, e.g. if I
compile with e.g. "make O=/tmp/foo". This is because make does not
know where to find bpf_helper_defs.h in that case.
I could solve it with the additional diff:
----
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index 45a37e2fb6e6..8b765993598b 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -127,7 +127,7 @@ $(OUTPUT)_bpftool: $(_OBJS) $(LIBBPF)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(_OBJS) $(LIBS)
skeleton/profiler.bpf.o: skeleton/profiler.bpf.c $(LIBBPF)
- $(QUIET_CLANG)$(CLANG) -I$(srctree)/tools/lib -g -O2 -target bpf -c $< -o $@
+ $(QUIET_CLANG)$(CLANG) -I$(srctree)/tools/lib -I$(LIBBPF_PATH) -g -O2 -target bpf -c $< -o $@
profiler.skel.h: $(OUTPUT)_bpftool skeleton/profiler.bpf.o
$(QUIET_GEN)$(OUTPUT)./_bpftool gen skeleton skeleton/profiler.bpf.o > $@
----
tools/testing/selftests/bpf/test_bpftool_build.sh seems happy on my
setup with the above.
Best regards,
Quentin
Powered by blists - more mailing lists