bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Quentin Monnet <quentin@isovalent.com>
To: Song Liu <songliubraving@fb.com>,
	netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: john.fastabend@gmail.com, kernel-team@fb.com, ast@kernel.org,
	daniel@iogearbox.net, arnaldo.melo@gmail.com, jolsa@kernel.org
Subject: Re: [PATCH v2 bpf-next 2/3] bpftool: skeleton should depend on libbpf
Date: Thu, 12 Mar 2020 12:34:40 +0000	[thread overview]
Message-ID: <bed6c51c-9a96-5957-7cd2-38f541e1dd6e@isovalent.com> (raw)
In-Reply-To: <bf7fdd9c-f43d-1ef5-dad3-961a4534463c@isovalent.com>

2020-03-12 11:46 UTC+0000 ~ Quentin Monnet <quentin@isovalent.com>
> 2020-03-11 15:18 UTC-0700 ~ Song Liu <songliubraving@fb.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@gmail.com>
>> Signed-off-by: Song Liu <songliubraving@fb.com>
> 
> Reviewed-by: Quentin Monnet <quentin@isovalent.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

  reply	other threads:[~2020-03-12 12:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 22:18 [PATCH v2 bpf-next 0/3] Fixes for bpftool-prog-profile Song Liu
2020-03-11 22:18 ` [PATCH v2 bpf-next 1/3] bpftool: only build bpftool-prog-profile if supported by clang Song Liu
2020-03-12 11:46   ` Quentin Monnet
2020-03-11 22:18 ` [PATCH v2 bpf-next 2/3] bpftool: skeleton should depend on libbpf Song Liu
2020-03-12 11:46   ` Quentin Monnet
2020-03-12 12:34     ` Quentin Monnet [this message]
2020-03-11 22:18 ` [PATCH v2 bpf-next 3/3] bpftool: add _bpftool and profiler.skel.h to .gitignore Song Liu
2020-03-12 11:47   ` Quentin Monnet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bed6c51c-9a96-5957-7cd2-38f541e1dd6e@isovalent.com \
    --to=quentin@isovalent.com \
    --cc=arnaldo.melo@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).