bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tobias Klauser <tklauser@distanz.ch>
To: Song Liu <songliubraving@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>, Yonghong Song <yhs@fb.com>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Subject: Re: [PATCH] bpftool: fix iprofiler build on systems without /usr/include/asm symlink
Date: Wed, 11 Mar 2020 17:06:48 +0100	[thread overview]
Message-ID: <20200311160647.bb57zyick37t5pck@distanz.ch> (raw)
In-Reply-To: <D8E0C5BC-E724-4788-86DA-EF8110237B6E@fb.com>

On 2020-03-11 at 16:55:38 +0100, Song Liu <songliubraving@fb.com> wrote:
> 
> 
> > On Mar 11, 2020, at 5:34 AM, Tobias Klauser <tklauser@distanz.ch> wrote:
> > 
> > When compiling bpftool on a system where the /usr/include/asm symlink
> > doesn't exist (e.g. on an Ubuntu system without gcc-multilib installed),
> > the build fails with:
> > 
> >    CLANG    skeleton/profiler.bpf.o
> >  In file included from skeleton/profiler.bpf.c:4:
> >  In file included from /usr/include/linux/bpf.h:11:
> >  /usr/include/linux/types.h:5:10: fatal error: 'asm/types.h' file not found
> >  #include <asm/types.h>
> >           ^~~~~~~~~~~~~
> >  1 error generated.
> >  make: *** [Makefile:123: skeleton/profiler.bpf.o] Error 1
> > 
> > To fix this, add /usr/include/$(uname -m)-linux-gnu to the clang search
> > path so <asm/types.h> can be found.
> > 
> > Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> 
> Looks good, with a nit below. 
> 
> Acked-by: Song Liu <songliubraving@fb.com>
> 
> > ---
> > tools/bpf/bpftool/Makefile | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> > index 20a90d8450f8..3cc0644fd91e 100644
> > --- a/tools/bpf/bpftool/Makefile
> > +++ b/tools/bpf/bpftool/Makefile
> > @@ -120,7 +120,7 @@ $(OUTPUT)_bpftool: $(_OBJS) $(LIBBPF)
> > 	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(_OBJS) $(LIBS)
> > 
> > skeleton/profiler.bpf.o: skeleton/profiler.bpf.c
> > -	$(QUIET_CLANG)$(CLANG) -I$(srctree)/tools/lib -g -O2 -target bpf -c $< -o $@
> > +	$(QUIET_CLANG)$(CLANG) -I/usr/include/$(shell uname -m)-linux-gnu -I$(srctree)/tools/lib -g -O2 -target bpf -c $< -o $@
> 
> Nit: this line is too long. It is better to break it into two lines. 

Thanks. Will send a v2, also with Toke's feedback regarding commit
message included.

  reply	other threads:[~2020-03-11 16:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 12:34 [PATCH] bpftool: fix iprofiler build on systems without /usr/include/asm symlink Tobias Klauser
2020-03-11 12:49 ` Toke Høiland-Jørgensen
2020-03-11 12:53   ` Tobias Klauser
2020-03-11 14:24     ` Toke Høiland-Jørgensen
2020-03-11 15:00       ` Tobias Klauser
2020-03-11 15:55 ` Song Liu
2020-03-11 16:06   ` Tobias Klauser [this message]
2020-03-11 16:14 ` [PATCH bpf-next v2] bpftool: fix profiler " Tobias Klauser
2020-03-11 17:26   ` Alexei Starovoitov
2020-03-11 19:42     ` Tobias Klauser
2020-03-12 10:30     ` Tobias Klauser

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=20200311160647.bb57zyick37t5pck@distanz.ch \
    --to=tklauser@distanz.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=songliubraving@fb.com \
    --cc=yhs@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).