From patchwork Thu Apr 14 22:45:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 12814094 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0346C433EF for ; Thu, 14 Apr 2022 22:46:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347238AbiDNWsf (ORCPT ); Thu, 14 Apr 2022 18:48:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347253AbiDNWsa (ORCPT ); Thu, 14 Apr 2022 18:48:30 -0400 Received: from mail-0301.mail-europe.com (mail-0301.mail-europe.com [188.165.51.139]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4BEAC6EF0; Thu, 14 Apr 2022 15:45:59 -0700 (PDT) Date: Thu, 14 Apr 2022 22:45:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail2; t=1649976355; bh=4UBxbz5wf4h5VLr17g7++AvyCOaKrTuecaQ7HkJeJ4c=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=MooR0+CEAV4XbA72GQZXTEX0qrP/7bHt4An7MuN15EsMiCeJbogR0SuNVdOa0OE6z i5+DpHyyLJJ93Op7sWb/op+qLU0EmssLRgsQvozEzp9XCuYj6OxIshSNSU9RqC/0Oh rUaMn5VIHKUuG4Vr7yn/ye0MEfT3ZHK0QwLU+Z3HP7UjnJLtV8rbSCsNs2o9lknyl3 zDaxvV7foY/Do1y9UGcYfDuYlthxRsfNMA15DpXT7vIEl4izRnpnOpeCivqxQ1q0Ma f68vfMrSc7K+gHtcmWUFMHgeMGPcdlBaL1OiaRrmvwFuNffHMfOdFLnVH4nCscDzqr +qg809I6lI6qQ== To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko From: Alexander Lobakin Cc: 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 , Alexander Lobakin , Dmitrii Dolgov <9erthalion6@gmail.com>, Quentin Monnet , Tiezhu Yang , Kumar Kartikeya Dwivedi , Chenbo Feng , Willem de Bruijn , Daniel Wagner , Thomas Graf , Ong Boon Leong , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, llvm@lists.linux.dev Reply-To: Alexander Lobakin Subject: [PATCH bpf-next 05/11] samples: bpf: use host bpftool to generate vmlinux.h, not target Message-ID: <20220414223704.341028-6-alobakin@pm.me> In-Reply-To: <20220414223704.341028-1-alobakin@pm.me> References: <20220414223704.341028-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net 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(-) -- 2.35.2 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,$@)