Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1015242pxb; Fri, 15 Apr 2022 18:25:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDheww4V4gpiMqhQK++X8tGDIEDf0sVffsdbeLBxt4xZG2HIzayzfZJfI3EA0sUmCz1UbB X-Received: by 2002:a17:903:11c7:b0:151:9769:3505 with SMTP id q7-20020a17090311c700b0015197693505mr1573809plh.72.1650072323121; Fri, 15 Apr 2022 18:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650072323; cv=none; d=google.com; s=arc-20160816; b=sE9Fb+e21w/huHqbUi5DzJjIF1vQNL0fQBQYEO+/kQJUTOUohIfOjqo6HE7YeBiTD+ t3AlMXUdGjmdA4BZs1k/vanOVwXwbuA/AIR61hbWr2PPn++KjKX//iQxhimOQ0vxNNzM MkFCyJv4YucwN4f9p4vihWXluVFyWY+/s4MGm7+pKjGaZB+HaTqUwCSYwxKt0yM34uyJ CXkQGMzaKVkjphpuf1pYsQk0THozQC81+YVTy3vQonkLppY2YCV7tlaiItCJ0hLBawxm I0PLN8UdY1Z7JG8pmsRRe7PRehuOJtl/65+n9afKuLG/ZR+eHO2jx4axa4OmLW4xMUWy YAXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VeR6Zypw12SOZGFz6pH4MM+oofmI3IwdzNhds9Ed/Mo=; b=NZnVfetQxo0fMcozZ54XoMraJCmaCTbplPekS0cQ4xfnYj5+9GmzzAH6L8pdGSwU+V JTkkoG3s+fA1CW5VivqpgjYduZxKKlvUDVpoL00LZNkdgRlMQdsnqaezVRJr3+2aTBHN zrN5dNNOurK4oYOX3A42O0NMY4Wgbmq4sgLzJHB+Pw/rMCMVQ7BTCGHgbtDZZosFRSG/ 0HQOfo0m9dTnh+x0M6nJ0XxSGxIXsARzZAhIF3q867E8A/hfb5D3zh37zZtRrhzmDqdb uw534m/lqLX6Hwafp01iiy2F8Anxs9HbzXg/k7kXwp3OQwfkqf3HrNC8oG8NyKTJz2Xb ZnnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mJ1RlEvM; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id lr9-20020a17090b4b8900b001c38029e0easi6239246pjb.53.2022.04.15.18.25.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 18:25:23 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mJ1RlEvM; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 49A72140B4; Fri, 15 Apr 2022 17:56:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351560AbiDOXrL (ORCPT + 99 others); Fri, 15 Apr 2022 19:47:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231481AbiDOXrH (ORCPT ); Fri, 15 Apr 2022 19:47:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51B4B1DA76; Fri, 15 Apr 2022 16:44:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 11D5CB831BA; Fri, 15 Apr 2022 23:44:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEC07C385B5; 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-f174.google.com with SMTP id 00721157ae682-2ec42eae76bso95397767b3.10; Fri, 15 Apr 2022 16:44:33 -0700 (PDT) X-Gm-Message-State: AOAM531TBasWG6PwFIGpd2/731feNo+rMVckWchXyajWxVMj2dUcoIXV 87lfdxdGMhqscm41+tvE2eWD5CF82+Px5eZIYIQ= 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) 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" X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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