From patchwork Thu Apr 21 00:39:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 12820967 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 8AE8EC433EF for ; Thu, 21 Apr 2022 00:41:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383514AbiDUAog (ORCPT ); Wed, 20 Apr 2022 20:44:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383512AbiDUAmW (ORCPT ); Wed, 20 Apr 2022 20:42:22 -0400 Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FC0627B23; Wed, 20 Apr 2022 17:39:34 -0700 (PDT) Date: Thu, 21 Apr 2022 00:39:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail2; t=1650501572; bh=v6gaFkC1lQ5OvOGA5jP895MtmOBP8Tdf6LrASizShuo=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=PFdTuOoCFpxSp4uLdYHgSLDaZVZwi7hatwlWmCfdP56Da7ptv/UBE8hO/VLSl1xAn lOkh92ooqW1lM/YySkpa4nxE/nsmnRPHmkW/Rhd1ZuDTDvT2o5k0hmI+E1/DsA+O7O TDyzviRTM4/nByU25Ar99spr1lC7wo7phHzCAeKvcKcgpNBojGFUJqhalRb0WyzN6l oIRGiLBv5xH0tkPZJxCTDur070BWsA3iRt0dAYOOwnHlItFmjiGlkAbG5h7KcS05nB zkV9ViBIHO//ZKcyS+V2Q7NsHosR/zRyXrk/0VNx9rggxhcHxfwXC6BRowRIcFARbS mezfQjhZThggg== To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko From: Alexander Lobakin Cc: Alexander Lobakin , Maciej Fijalkowski , Song Liu , Kumar Kartikeya Dwivedi , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH v2 bpf 06/11] samples/bpf: use host bpftool to generate vmlinux.h, not target Message-ID: <20220421003152.339542-7-alobakin@pm.me> In-Reply-To: <20220421003152.339542-1-alobakin@pm.me> References: <20220421003152.339542-1-alobakin@pm.me> Feedback-ID: 22809121:user:proton 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") Acked-by: Kumar Kartikeya Dwivedi Acked-by: Song Liu Signed-off-by: Alexander Lobakin --- samples/bpf/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.36.0 diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 70323ac1114f..2bb9088a8d91 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,$@)