From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id D11397D910 for ; Wed, 11 Mar 2020 16:06:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729989AbgCKQGv (ORCPT ); Wed, 11 Mar 2020 12:06:51 -0400 Received: from sym2.noone.org ([178.63.92.236]:32886 "EHLO sym2.noone.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729921AbgCKQGv (ORCPT ); Wed, 11 Mar 2020 12:06:51 -0400 Received: by sym2.noone.org (Postfix, from userid 1002) id 48cxfc5lPBzvjdW; Wed, 11 Mar 2020 17:06:48 +0100 (CET) Date: Wed, 11 Mar 2020 17:06:48 +0100 From: Tobias Klauser To: Song Liu Cc: Daniel Borkmann , Alexei Starovoitov , Yonghong Song , "bpf@vger.kernel.org" Subject: Re: [PATCH] bpftool: fix iprofiler build on systems without /usr/include/asm symlink Message-ID: <20200311160647.bb57zyick37t5pck@distanz.ch> References: <20200311123421.3634-1-tklauser@distanz.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Archived-At: List-Archive: List-Post: On 2020-03-11 at 16:55:38 +0100, Song Liu wrote: > > > > On Mar 11, 2020, at 5:34 AM, Tobias Klauser 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 > > ^~~~~~~~~~~~~ > > 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 can be found. > > > > Signed-off-by: Tobias Klauser > > Looks good, with a nit below. > > Acked-by: Song Liu > > > --- > > 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.