From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D10033F4 for ; Fri, 15 Apr 2022 23:44:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA3CDC385AB for ; Fri, 15 Apr 2022 23:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650066273; bh=BJ4yI4e3T5R6YlCYcwG8kMVsAMKr7M9Y5rWC/P9WuUE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mJ1RlEvMAjER3ZFVI3HSyIhLCsQ35tUuVOBeDnMIZ0DlAI3v6ypwthCCrooCwmpXe EATUHvvfNPth3qDMEZMcKFJPxPpCI4gHo4b0nkisuE+3UJiCIn42qkXfarwjvQav/p 33Nb+rGdJ/K47qK9VdaLqurM2SJMXw0j39A5jFzu+4J3O1PFEYBA6UttDD+dthQc0A oQJH6WrnURgeLXt+ef+BnkPJ6kptXn6Wuxs308U91k29Ahii3KPD5rINAqpU9CnCmc ghZOo2SoU9t8I0Pdw9sZIxK0P3xk1Lok9+YaNS1Bu+nHEVbUkM1upWawXHfKmOvqxL y7JlQNp5fi1YQ== Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-2ebebe631ccso95728397b3.4 for ; Fri, 15 Apr 2022 16:44:33 -0700 (PDT) X-Gm-Message-State: AOAM533VAq36WulnZNACsVZk1gWwfX5E0vyl7hc+4kPfpMyJ39Aq0vMN LNGqV2jFaiHAmT8pyz8pLJ2B31AvY1wedLn3MeA= X-Google-Smtp-Source: ABdhPJw9968jTzOt6gz9W4g0aOTltkD6p3FL8bzMBCVOFNwz4HrVPX4+c4iPXHNR2KMviPIXoPxm7E95Zzzie3H5GUk= X-Received: by 2002:a81:5087:0:b0:2ef:33c1:fccd with SMTP id e129-20020a815087000000b002ef33c1fccdmr1182835ywb.73.1650066272767; Fri, 15 Apr 2022 16:44:32 -0700 (PDT) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20220414223704.341028-1-alobakin@pm.me> <20220414223704.341028-6-alobakin@pm.me> <20220415133839.y6tjf3ymbvbrntx4@apollo.legion> In-Reply-To: <20220415133839.y6tjf3ymbvbrntx4@apollo.legion> From: Song Liu Date: Fri, 15 Apr 2022 16:44:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH bpf-next 05/11] samples: bpf: use host bpftool to generate vmlinux.h, not target To: Kumar Kartikeya Dwivedi Cc: Alexander Lobakin , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , Jonathan Lemon , Nathan Chancellor , Nick Desaulniers , Dmitrii Dolgov <9erthalion6@gmail.com>, Quentin Monnet , Tiezhu Yang , Chenbo Feng , Willem de Bruijn , Daniel Wagner , Thomas Graf , Ong Boon Leong , linux-perf-users@vger.kernel.org, open list , Networking , bpf , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" On Fri, Apr 15, 2022 at 6:38 AM Kumar Kartikeya Dwivedi wrote: > > On Fri, Apr 15, 2022 at 04:15:50AM IST, Alexander Lobakin wrote: > > Use the host build of bpftool (bootstrap) instead of the target one > > to generate vmlinux.h/skeletons for the BPF samples. Otherwise, when > > host != target, samples compilation fails with: > > > > /bin/sh: line 1: samples/bpf/bpftool/bpftool: failed to exec: Exec > > format error > > > > Fixes: 384b6b3bbf0d ("samples: bpf: Add vmlinux.h generation support") > > Signed-off-by: Alexander Lobakin > > --- > > Acked-by: Kumar Kartikeya Dwivedi Acked-by: Song Liu > > > samples/bpf/Makefile | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile > > index 97203c0de252..02f999a8ef84 100644 > > --- a/samples/bpf/Makefile > > +++ b/samples/bpf/Makefile > > @@ -291,12 +291,13 @@ $(LIBBPF): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(LIBBPF_OU > > > > BPFTOOLDIR := $(TOOLS_PATH)/bpf/bpftool > > BPFTOOL_OUTPUT := $(abspath $(BPF_SAMPLES_PATH))/bpftool > > -BPFTOOL := $(BPFTOOL_OUTPUT)/bpftool > > +BPFTOOL := $(BPFTOOL_OUTPUT)/bootstrap/bpftool > > $(BPFTOOL): $(LIBBPF) $(wildcard $(BPFTOOLDIR)/*.[ch] $(BPFTOOLDIR)/Makefile) | $(BPFTOOL_OUTPUT) > > $(MAKE) -C $(BPFTOOLDIR) srctree=$(BPF_SAMPLES_PATH)/../../ \ > > OUTPUT=$(BPFTOOL_OUTPUT)/ \ > > LIBBPF_OUTPUT=$(LIBBPF_OUTPUT)/ \ > > - LIBBPF_DESTDIR=$(LIBBPF_DESTDIR)/ > > + LIBBPF_DESTDIR=$(LIBBPF_DESTDIR)/ \ > > + bootstrap > > > > $(LIBBPF_OUTPUT) $(BPFTOOL_OUTPUT): > > $(call msg,MKDIR,$@) > > -- > > 2.35.2 > > > > > > -- > Kartikeya