From patchwork Tue Nov 10 16:43:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 11894837 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FE2CC56201 for ; Tue, 10 Nov 2020 16:43:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDAF8207D3 for ; Tue, 10 Nov 2020 16:43:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hRDbxVtP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730258AbgKJQnq (ORCPT ); Tue, 10 Nov 2020 11:43:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730108AbgKJQnp (ORCPT ); Tue, 10 Nov 2020 11:43:45 -0500 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F4A2C0613D3 for ; Tue, 10 Nov 2020 08:43:44 -0800 (PST) Received: by mail-wr1-x442.google.com with SMTP id 23so13386780wrc.8 for ; Tue, 10 Nov 2020 08:43:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VjwgR6IegN0z1NgSz9sFMF8qxZSIVhoD/xcsqEVjbjk=; b=hRDbxVtP8Bios4GvyB/JdFEuyInSAcr/KlNtotz6w15n8CkE/fDJLM5f8Hz0dwJc+W C20pXtLJNa5m/C4yl2wP44s4TWAX60FeWMtnzVfobdd4hy5BjulDIcn7+sNLGMPyOATH OFVK9Diwgd1OWNWx3wE3KFK1ywp/Owqf23SWIIn2wuwzJV30ljm+FJwIVfF/gPKkk+sC ghynYm/HCo7Kjf67Fv7vgwMWYXqqKzFlfllcDivrEPqDng/lH7nJE/FpxtwLYhKIMvd0 sTGllGmbLr3xhBijPQsL7SRbLveBFwNvZclLiW9k4hrpmDq9IFcmY8cAYOTeIxiVqxGs PrDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VjwgR6IegN0z1NgSz9sFMF8qxZSIVhoD/xcsqEVjbjk=; b=eOxMu4Fl52vRFjGZjmcye4IoBFHbrmEdyDD5Bk2FBQVPFnJZXQ8+VV2fOkceKtSkHF QnXB0trmQn8gIkW6uTcdyGtkAa22ao0E9GGYoOdJLK0b4s1gfuAqmRUqIWXlkCj5qNXR vVDVR0OzKew0QBOPT9PTlCRxGJuh0R3oiAW6CZBaE8nkHy0okzyPRa7Fx36G0lz+yfvl Ixpz0P/0zatuktoAxyPS2839sZtAq1NrPk1F/r8wVYVzyaSdE0LB551CNp38LPT9VALt N/jGRhvJxRRWdAmS1GI5JGz3HsYLgnxe8Y/HBY69wn7EKq1zMzd3Gdb4yPgHWK650l2k v7bQ== X-Gm-Message-State: AOAM5309HGMZelA1qKitA6OKKdCIjbke/jk6pvWERXjEABguaR+SGW4y nE714pn72yGcWyMYNlWGXy/KBA== X-Google-Smtp-Source: ABdhPJxjl5TWwjIq/qIhSHNeR2tjI0GfyAcylwfdltw5FFUB3qolv2WQE7bUWpljss9gPnIxtzgV/Q== X-Received: by 2002:a5d:5752:: with SMTP id q18mr23918165wrw.176.1605026622750; Tue, 10 Nov 2020 08:43:42 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id n123sm3272268wmn.38.2020.11.10.08.43.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 08:43:42 -0800 (PST) From: Jean-Philippe Brucker To: ast@kernel.org, daniel@iogearbox.net Cc: bpf@vger.kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, andriin@fb.com, john.fastabend@gmail.com, kpsingh@chromium.org, Jean-Philippe Brucker , Jiri Olsa , "Rafael J . Wysocki" , Josh Poimboeuf , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , Robert Moore , Erik Kaneda , Len Brown , linux-acpi@vger.kernel.org, devel@acpica.org Subject: [PATCH bpf-next v3 1/7] tools: Factor HOSTCC, HOSTLD, HOSTAR definitions Date: Tue, 10 Nov 2020 17:43:05 +0100 Message-Id: <20201110164310.2600671-2-jean-philippe@linaro.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201110164310.2600671-1-jean-philippe@linaro.org> References: <20201110164310.2600671-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Several Makefiles in tools/ need to define the host toolchain variables. Move their definition to tools/scripts/Makefile.include Acked-by: Jiri Olsa Acked-by: Rafael J. Wysocki Signed-off-by: Jean-Philippe Brucker --- v1: https://lore.kernel.org/bpf/20200827153629.3820891-2-jean-philippe@linaro.org/ v2: https://lore.kernel.org/bpf/20201109110929.1223538-2-jean-philippe@linaro.org/ Cc: Josh Poimboeuf Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Robert Moore Cc: Erik Kaneda Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: linux-acpi@vger.kernel.org Cc: devel@acpica.org --- tools/bpf/resolve_btfids/Makefile | 9 --------- tools/build/Makefile | 4 ---- tools/objtool/Makefile | 9 --------- tools/perf/Makefile.perf | 4 ---- tools/power/acpi/Makefile.config | 1 - tools/scripts/Makefile.include | 10 ++++++++++ 6 files changed, 10 insertions(+), 27 deletions(-) diff --git a/tools/bpf/resolve_btfids/Makefile b/tools/bpf/resolve_btfids/Makefile index 66cb92136de4..bf656432ad73 100644 --- a/tools/bpf/resolve_btfids/Makefile +++ b/tools/bpf/resolve_btfids/Makefile @@ -18,15 +18,6 @@ else endif # always use the host compiler -ifneq ($(LLVM),) -HOSTAR ?= llvm-ar -HOSTCC ?= clang -HOSTLD ?= ld.lld -else -HOSTAR ?= ar -HOSTCC ?= gcc -HOSTLD ?= ld -endif AR = $(HOSTAR) CC = $(HOSTCC) LD = $(HOSTLD) diff --git a/tools/build/Makefile b/tools/build/Makefile index 722f1700d96a..bae48e6fa995 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -15,10 +15,6 @@ endef $(call allow-override,CC,$(CROSS_COMPILE)gcc) $(call allow-override,LD,$(CROSS_COMPILE)ld) -HOSTCC ?= gcc -HOSTLD ?= ld -HOSTAR ?= ar - export HOSTCC HOSTLD HOSTAR ifeq ($(V),1) diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile index 4ea9a833dde7..5cdb19036d7f 100644 --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -3,15 +3,6 @@ include ../scripts/Makefile.include include ../scripts/Makefile.arch # always use the host compiler -ifneq ($(LLVM),) -HOSTAR ?= llvm-ar -HOSTCC ?= clang -HOSTLD ?= ld.lld -else -HOSTAR ?= ar -HOSTCC ?= gcc -HOSTLD ?= ld -endif AR = $(HOSTAR) CC = $(HOSTCC) LD = $(HOSTLD) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 7ce3f2e8b9c7..62f3deb1d3a8 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -175,10 +175,6 @@ endef LD += $(EXTRA_LDFLAGS) -HOSTCC ?= gcc -HOSTLD ?= ld -HOSTAR ?= ar - PKG_CONFIG = $(CROSS_COMPILE)pkg-config LLVM_CONFIG ?= llvm-config diff --git a/tools/power/acpi/Makefile.config b/tools/power/acpi/Makefile.config index 54a2857c2510..331f6d30f472 100644 --- a/tools/power/acpi/Makefile.config +++ b/tools/power/acpi/Makefile.config @@ -54,7 +54,6 @@ INSTALL_SCRIPT = ${INSTALL_PROGRAM} CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- CROSS_COMPILE ?= $(CROSS) LD = $(CC) -HOSTCC = gcc # check if compiler option is supported cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;} diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include index a7974638561c..1358e89cdf7d 100644 --- a/tools/scripts/Makefile.include +++ b/tools/scripts/Makefile.include @@ -59,6 +59,16 @@ $(call allow-override,LD,$(CROSS_COMPILE)ld) $(call allow-override,CXX,$(CROSS_COMPILE)g++) $(call allow-override,STRIP,$(CROSS_COMPILE)strip) +ifneq ($(LLVM),) +HOSTAR ?= llvm-ar +HOSTCC ?= clang +HOSTLD ?= ld.lld +else +HOSTAR ?= ar +HOSTCC ?= gcc +HOSTLD ?= ld +endif + ifeq ($(CC_NO_CLANG), 1) EXTRA_WARNINGS += -Wstrict-aliasing=3 endif From patchwork Tue Nov 10 16:43:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 11894839 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 649BDC55ABD for ; Tue, 10 Nov 2020 16:43:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B674205CB for ; Tue, 10 Nov 2020 16:43:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="lRvu9QeD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730432AbgKJQnr (ORCPT ); Tue, 10 Nov 2020 11:43:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730299AbgKJQnq (ORCPT ); Tue, 10 Nov 2020 11:43:46 -0500 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C599C0613CF for ; Tue, 10 Nov 2020 08:43:45 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id r17so9473568wrw.1 for ; Tue, 10 Nov 2020 08:43:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TyxsQyLla1zclispG+4axUyIMnk5XI6pp50Xi/hRHCg=; b=lRvu9QeDUXvFCpJx6aJDdw5xyVT4J992cOM4YPW2ZCQ0qWixjkRccsTG2ZebUB1oxW V7ZMw1sKC+Vpx1dGAdYEnrexKIcP0fDyWxjpeMj0wyfZHbdVi8ui2Ia0LKT+83yz7Ice 1eJvMHYP/iBrApt/tFTqWWOtlXat6RhEJNRr0jJgGGYQr+2qKf3ps9uZ26BlgriEwJj6 1tPftHBExXomBI5Tdq95gv4TEzy3UUn7aoTkkwq5TnNiKQHoaWFv39caLiGh380VNuVB dsjgC4qlLS7bcyWX6awbBrPsVdOcll0pxlQyYWKCe/HH34n9dzNQct+NsX2uHmfR7NHe RyHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TyxsQyLla1zclispG+4axUyIMnk5XI6pp50Xi/hRHCg=; b=QcqA7snscOcyBnwLXvtCfv7rlSUAHR2tYSf8ZKY95Kgi4e7tQMG9q+9MJW3z1IrqP7 +Xw/pBcYjgCJIN23bGLfoRR6NhaDW+1DghXedh+TUkDQ/mMxAvyDfWiCUcMH4pFM0ZLY twvJcZVlMmfycfkvz3ZprtzeWr4AcwT9EIOra4ebuyDIe2Dc8uzAw0S9m4MyoNvs8rVl iYdKEgjt8gEFz/egwZYeG1OqGi43I72p/y+04K34r4ebdD+SdV487MX+IcDh+6bUJBTq yh6dmtApi96Q3SJFp754Nn8zeW+DDw2AuABqQuJqZDaB8cM9GEYW22OBg2u2a1LbIEap CK5w== X-Gm-Message-State: AOAM531S82Wv6XtgIBUXiq2qIGvzV+u5EQzKOVen0vk2ktc9qkPbxtP0 Ldc+lD3K6JTOkR3NERVCGv48SA== X-Google-Smtp-Source: ABdhPJzYQi3SiNNG6uhpQ32ZgSPvA4i+S4zQ2Y7aG43xODiLADxgdushkfONnwJl1oDyvbQHSHTM7A== X-Received: by 2002:adf:c143:: with SMTP id w3mr24702098wre.62.1605026623908; Tue, 10 Nov 2020 08:43:43 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id n123sm3272268wmn.38.2020.11.10.08.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 08:43:43 -0800 (PST) From: Jean-Philippe Brucker To: ast@kernel.org, daniel@iogearbox.net Cc: bpf@vger.kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, andriin@fb.com, john.fastabend@gmail.com, kpsingh@chromium.org, Jean-Philippe Brucker Subject: [PATCH bpf-next v3 2/7] tools/bpftool: Force clean of out-of-tree build Date: Tue, 10 Nov 2020 17:43:06 +0100 Message-Id: <20201110164310.2600671-3-jean-philippe@linaro.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201110164310.2600671-1-jean-philippe@linaro.org> References: <20201110164310.2600671-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Cleaning a partial build can fail if the output directory for libbpf wasn't created: $ make -C tools/bpf/bpftool O=/tmp/bpf clean /bin/sh: line 0: cd: /tmp/bpf/libbpf/: No such file or directory tools/scripts/Makefile.include:17: *** output directory "/tmp/bpf/libbpf/" does not exist. Stop. make: *** [Makefile:36: /tmp/bpf/libbpf/libbpf.a-clean] Error 2 As a result make never gets around to clearing the leftover objects. Add the libbpf output directory as clean dependency to ensure clean always succeeds (similarly to the "descend" macro). The directory is later removed by the clean recipe. Signed-off-by: Jean-Philippe Brucker --- tools/bpf/bpftool/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index f60e6ad3a1df..1358c093b812 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -27,11 +27,13 @@ LIBBPF = $(LIBBPF_PATH)libbpf.a BPFTOOL_VERSION ?= $(shell make -rR --no-print-directory -sC ../../.. kernelversion) -$(LIBBPF): FORCE - $(if $(LIBBPF_OUTPUT),@mkdir -p $(LIBBPF_OUTPUT)) +$(LIBBPF_OUTPUT): + $(QUIET_MKDIR)mkdir -p $@ + +$(LIBBPF): FORCE | $(LIBBPF_OUTPUT) $(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_OUTPUT) $(LIBBPF_OUTPUT)libbpf.a -$(LIBBPF)-clean: +$(LIBBPF)-clean: $(LIBBPF_OUTPUT) $(call QUIET_CLEAN, libbpf) $(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_OUTPUT) clean >/dev/null From patchwork Tue Nov 10 16:43:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 11894847 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 570ADC55ABD for ; Tue, 10 Nov 2020 16:43:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA6EC207D3 for ; Tue, 10 Nov 2020 16:43:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="OOnHb4J5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730397AbgKJQnr (ORCPT ); Tue, 10 Nov 2020 11:43:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730285AbgKJQnq (ORCPT ); Tue, 10 Nov 2020 11:43:46 -0500 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DF65C0613D3 for ; Tue, 10 Nov 2020 08:43:46 -0800 (PST) Received: by mail-wr1-x442.google.com with SMTP id k2so10014216wrx.2 for ; Tue, 10 Nov 2020 08:43:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hv+MtdKXTpTLctYjLMkmsc3F3M6Gdqr5InIXmGWvKwk=; b=OOnHb4J5diup+46RtfT6miy4Jbx6ll+JMWIGjFKk41MgyC/GbTW0Fjx0z6RQ6WMKbN YJCgkDHTgVDJ2XFw81dXMT2a2mxSNWwqFsJCRLoFbFVclFzY6Q/7Fivt83XJJmLHM/ZC iT6pQBaPTD+yf5JToRvuoqkX0CDcvyAQg59kKii9pwLEdUlPxhFNyeTkkmoIfi9gbFJJ YfA3+ybWejW1miUEFnXqFEPjkqa06FD7VVyqvpNl0KmhNmtymer/+PqeGD+yhcazCuc0 GMLmkUYcwfcOP7ErZDGlzBn8k4YeCeebwndlr4E+cnXTvuUQiZPa8HQ4TknDDiGrugZy RcHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hv+MtdKXTpTLctYjLMkmsc3F3M6Gdqr5InIXmGWvKwk=; b=cvwEn6q2RSi1/WDOFxULyusSaRUDs3U0jXgtuyM3d01RL+9i4utAPq2CrLOXlZHSWr XFVjjtbrPSyGxvuFDqWdEMuJLT/i9wmgYjQ1io+wKor815kQePWQ424okhiA9QuNS/Bo xiQN9Ep/NESv4jr+hOeTUGGAikI2zTFy6QLhRLS6WYvnmdnXqVeHksAOluwkUmICPQak isSHKndFosTBqBy0nIeN63zTBJC7h2f5nLc/L2lAqiWoTrUNeeK0CgErh1MysT0JHPPV a+BeTjn8TisDRwstrZCSgKkvjLuU61yvdfbWweyFI4YnWunkBaIXNyP07KIfpQp//dNk Vwpw== X-Gm-Message-State: AOAM531VOZNVdviIAZsyzQRS9N1/Hk0y4RFl36Y3KVVq+dTPRhABJsiH WTKlntz4UnoqA9q8++DmDi1uow== X-Google-Smtp-Source: ABdhPJyvD4jOKjkmZb8/EoHle8cQTFf91s0eSmjc0zOnksZaAuDEADX+u6PVrlznyuo/VNx52UF/6Q== X-Received: by 2002:a5d:6cc5:: with SMTP id c5mr24883181wrc.301.1605026624947; Tue, 10 Nov 2020 08:43:44 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id n123sm3272268wmn.38.2020.11.10.08.43.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 08:43:44 -0800 (PST) From: Jean-Philippe Brucker To: ast@kernel.org, daniel@iogearbox.net Cc: bpf@vger.kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, andriin@fb.com, john.fastabend@gmail.com, kpsingh@chromium.org, Jean-Philippe Brucker Subject: [PATCH bpf-next v3 3/7] tools/bpftool: Fix cross-build Date: Tue, 10 Nov 2020 17:43:07 +0100 Message-Id: <20201110164310.2600671-4-jean-philippe@linaro.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201110164310.2600671-1-jean-philippe@linaro.org> References: <20201110164310.2600671-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net The bpftool build first creates an intermediate binary, executed on the host, to generate skeletons required by the final build. When cross-building bpftool for an architecture different from the host, the intermediate binary should be built using the host compiler (gcc) and the final bpftool using the cross compiler (e.g. aarch64-linux-gnu-gcc). Generate the intermediate objects into the bootstrap/ directory using the host toolchain. Signed-off-by: Jean-Philippe Brucker Acked-by: Andrii Nakryiko --- v3: Always set LIBBPF_OUTPUT. Tidy the clean recipe. --- tools/bpf/bpftool/Makefile | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index 1358c093b812..d566bced135e 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -19,24 +19,37 @@ BPF_DIR = $(srctree)/tools/lib/bpf/ ifneq ($(OUTPUT),) LIBBPF_OUTPUT = $(OUTPUT)/libbpf/ LIBBPF_PATH = $(LIBBPF_OUTPUT) + BOOTSTRAP_OUTPUT = $(OUTPUT)/bootstrap/ else + LIBBPF_OUTPUT = LIBBPF_PATH = $(BPF_DIR) + BOOTSTRAP_OUTPUT = $(CURDIR)/bootstrap/ endif LIBBPF = $(LIBBPF_PATH)libbpf.a +LIBBPF_BOOTSTRAP_OUTPUT = $(BOOTSTRAP_OUTPUT)libbpf/ +LIBBPF_BOOTSTRAP = $(LIBBPF_BOOTSTRAP_OUTPUT)libbpf.a BPFTOOL_VERSION ?= $(shell make -rR --no-print-directory -sC ../../.. kernelversion) -$(LIBBPF_OUTPUT): +$(LIBBPF_OUTPUT) $(BOOTSTRAP_OUTPUT) $(LIBBPF_BOOTSTRAP_OUTPUT): $(QUIET_MKDIR)mkdir -p $@ $(LIBBPF): FORCE | $(LIBBPF_OUTPUT) $(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_OUTPUT) $(LIBBPF_OUTPUT)libbpf.a +$(LIBBPF_BOOTSTRAP): FORCE | $(LIBBPF_BOOTSTRAP_OUTPUT) + $(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_BOOTSTRAP_OUTPUT) \ + ARCH= CC=$(HOSTCC) LD=$(HOSTLD) $@ + $(LIBBPF)-clean: $(LIBBPF_OUTPUT) $(call QUIET_CLEAN, libbpf) $(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_OUTPUT) clean >/dev/null +$(LIBBPF_BOOTSTRAP)-clean: $(LIBBPF_BOOTSTRAP_OUTPUT) + $(call QUIET_CLEAN, libbpf-bootstrap) + $(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_BOOTSTRAP_OUTPUT) clean >/dev/null + prefix ?= /usr/local bash_compdir ?= /usr/share/bash-completion/completions @@ -94,6 +107,7 @@ CFLAGS += -DCOMPAT_NEED_REALLOCARRAY endif LIBS = $(LIBBPF) -lelf -lz +LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz ifeq ($(feature-libcap), 1) CFLAGS += -DUSE_LIBCAP LIBS += -lcap @@ -120,9 +134,9 @@ CFLAGS += -DHAVE_LIBBFD_SUPPORT SRCS += $(BFD_SRCS) endif -BPFTOOL_BOOTSTRAP := $(if $(OUTPUT),$(OUTPUT)bpftool-bootstrap,./bpftool-bootstrap) +BPFTOOL_BOOTSTRAP := $(BOOTSTRAP_OUTPUT)bpftool -BOOTSTRAP_OBJS = $(addprefix $(OUTPUT),main.o common.o json_writer.o gen.o btf.o) +BOOTSTRAP_OBJS = $(addprefix $(BOOTSTRAP_OUTPUT),main.o common.o json_writer.o gen.o btf.o) OBJS = $(patsubst %.c,$(OUTPUT)%.o,$(SRCS)) $(OUTPUT)disasm.o VMLINUX_BTF_PATHS ?= $(if $(O),$(O)/vmlinux) \ @@ -169,12 +183,16 @@ $(OUTPUT)disasm.o: $(srctree)/kernel/bpf/disasm.c $(OUTPUT)feature.o: | zdep -$(BPFTOOL_BOOTSTRAP): $(BOOTSTRAP_OBJS) $(LIBBPF) - $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(BOOTSTRAP_OBJS) $(LIBS) +$(BPFTOOL_BOOTSTRAP): $(BOOTSTRAP_OBJS) $(LIBBPF_BOOTSTRAP) + $(QUIET_LINK)$(HOSTCC) $(CFLAGS) $(LDFLAGS) -o $@ $(BOOTSTRAP_OBJS) \ + $(LIBS_BOOTSTRAP) $(OUTPUT)bpftool: $(OBJS) $(LIBBPF) $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) +$(BOOTSTRAP_OUTPUT)%.o: %.c | $(BOOTSTRAP_OUTPUT) + $(QUIET_CC)$(HOSTCC) $(CFLAGS) -c -MMD -o $@ $< + $(OUTPUT)%.o: %.c $(QUIET_CC)$(CC) $(CFLAGS) -c -MMD -o $@ $< @@ -182,11 +200,11 @@ feature-detect-clean: $(call QUIET_CLEAN, feature-detect) $(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null -clean: $(LIBBPF)-clean feature-detect-clean +clean: $(LIBBPF)-clean $(LIBBPF_BOOTSTRAP)-clean feature-detect-clean $(call QUIET_CLEAN, bpftool) $(Q)$(RM) -- $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d - $(Q)$(RM) -- $(BPFTOOL_BOOTSTRAP) $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h - $(Q)$(RM) -r -- $(OUTPUT)libbpf/ + $(Q)$(RM) -- $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h + $(Q)$(RM) -r -- $(LIBBPF_OUTPUT) $(BOOTSTRAP_OUTPUT) $(call QUIET_CLEAN, core-gen) $(Q)$(RM) -- $(OUTPUT)FEATURE-DUMP.bpftool $(Q)$(RM) -r -- $(OUTPUT)feature/ From patchwork Tue Nov 10 16:43:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 11894841 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC26FC5517A for ; Tue, 10 Nov 2020 16:43:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6548C20809 for ; Tue, 10 Nov 2020 16:43:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="D1c6u/Q7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730473AbgKJQns (ORCPT ); Tue, 10 Nov 2020 11:43:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730108AbgKJQnr (ORCPT ); Tue, 10 Nov 2020 11:43:47 -0500 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C7BFC0613CF for ; Tue, 10 Nov 2020 08:43:47 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id k2so10014285wrx.2 for ; Tue, 10 Nov 2020 08:43:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QKZ4+2eyEb4R1RRmvhM/k0lBeo2ErDz99RkSgDH/CpM=; b=D1c6u/Q7Uivtn1YqumM/Mx5XpBbog/Tpl2dysPAcY7xtJNaZELtI+Fg8rDqBQeqLAZ Zmx/rT9ingEjcqrtwdsPU+gkpgQRhEj3cb+Anqw0uD/22n1IheDiQw0wxxLLNJWKcWI9 A0+OKDJ7LTVFqm2MYJwK0he6BLNY9Y8RleEbIxA/62zX/glci4sfSaXOXRCL1OA/MDMI xXsFpt30V9kg6VUN3P2EWkINQ+S/hCQUCd1mkB3/OWIEgUKaN2nZzrUFdEiqLIJU4FCz TFv/ZcXUJfPAaN8rJM89d638wzCxFPginIKs1fxgC9GvKe8cyF76vLeta/09WEBROeWk aNBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QKZ4+2eyEb4R1RRmvhM/k0lBeo2ErDz99RkSgDH/CpM=; b=H79VngsnBlhCcqZn2zDIN4LRs+8NbIYXDIzC34KJi/RVb85CONR76HFP/Qn7VyfNLp xo9Zt54yu1n9v8611I9v22Pip40HCycgbUgazBoLrB7XabgRe0stS4AaGEphlxFp25c9 odKb3NWO0hltB7/8oMX1f/RPZy2abGjR5+TRBtvfy6BAB+AxfY9dttj1XK2XhAT/YmkT ws3ssrln1DH8EVy3Q+i0/WFIsB1GJK5zpXyPHqrHduDu3lvLeeWRb8mXBrT8hhERTvn+ ISnhJfA1N3zBqnK1rIkn6+LFUyV2R6pvS9GXnqNCvBIbaib/GzaKiiyTxVnUO8p85aev kQbg== X-Gm-Message-State: AOAM531nFlTPNkNjhO2O+jFyh0CoiLbRSEFxFgurxkxMFRy1oj3vvFAH EmvohMafHEmOQbvBhDQK/s8q1A== X-Google-Smtp-Source: ABdhPJwIo2ZPFRCBHa/r8BrH6Q0b5zggNR7iQI+uIpmQqCkhmMYKmHzCeSNGlZpJD8Y0DIgPjRIlng== X-Received: by 2002:a5d:4a07:: with SMTP id m7mr23698904wrq.316.1605026626076; Tue, 10 Nov 2020 08:43:46 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id n123sm3272268wmn.38.2020.11.10.08.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 08:43:45 -0800 (PST) From: Jean-Philippe Brucker To: ast@kernel.org, daniel@iogearbox.net Cc: bpf@vger.kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, andriin@fb.com, john.fastabend@gmail.com, kpsingh@chromium.org, Jean-Philippe Brucker Subject: [PATCH bpf-next v3 4/7] tools/runqslower: Use Makefile.include Date: Tue, 10 Nov 2020 17:43:08 +0100 Message-Id: <20201110164310.2600671-5-jean-philippe@linaro.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201110164310.2600671-1-jean-philippe@linaro.org> References: <20201110164310.2600671-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Makefile.include defines variables such as OUTPUT and CC for out-of-tree build and cross-build. Include it into the runqslower Makefile and use its $(QUIET*) helpers. Signed-off-by: Jean-Philippe Brucker Acked-by: Andrii Nakryiko --- tools/bpf/runqslower/Makefile | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/tools/bpf/runqslower/Makefile b/tools/bpf/runqslower/Makefile index fb1337d69868..bcc4a7396713 100644 --- a/tools/bpf/runqslower/Makefile +++ b/tools/bpf/runqslower/Makefile @@ -1,4 +1,6 @@ # SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +include ../../scripts/Makefile.include + OUTPUT := .output CLANG ?= clang LLC ?= llc @@ -21,10 +23,8 @@ VMLINUX_BTF_PATH := $(or $(VMLINUX_BTF),$(firstword \ abs_out := $(abspath $(OUTPUT)) ifeq ($(V),1) Q = -msg = else Q = @ -msg = @printf ' %-8s %s%s\n' "$(1)" "$(notdir $(2))" "$(if $(3), $(3))"; MAKEFLAGS += --no-print-directory submake_extras := feature_display=0 endif @@ -37,12 +37,11 @@ all: runqslower runqslower: $(OUTPUT)/runqslower clean: - $(call msg,CLEAN) + $(call QUIET_CLEAN, runqslower) $(Q)rm -rf $(OUTPUT) runqslower $(OUTPUT)/runqslower: $(OUTPUT)/runqslower.o $(BPFOBJ) - $(call msg,BINARY,$@) - $(Q)$(CC) $(CFLAGS) $^ -lelf -lz -o $@ + $(QUIET_LINK)$(CC) $(CFLAGS) $^ -lelf -lz -o $@ $(OUTPUT)/runqslower.o: runqslower.h $(OUTPUT)/runqslower.skel.h \ $(OUTPUT)/runqslower.bpf.o @@ -50,31 +49,26 @@ $(OUTPUT)/runqslower.o: runqslower.h $(OUTPUT)/runqslower.skel.h \ $(OUTPUT)/runqslower.bpf.o: $(OUTPUT)/vmlinux.h runqslower.h $(OUTPUT)/%.skel.h: $(OUTPUT)/%.bpf.o | $(BPFTOOL) - $(call msg,GEN-SKEL,$@) - $(Q)$(BPFTOOL) gen skeleton $< > $@ + $(QUIET_GEN)$(BPFTOOL) gen skeleton $< > $@ $(OUTPUT)/%.bpf.o: %.bpf.c $(BPFOBJ) | $(OUTPUT) - $(call msg,BPF,$@) - $(Q)$(CLANG) -g -O2 -target bpf $(INCLUDES) \ + $(QUIET_GEN)$(CLANG) -g -O2 -target bpf $(INCLUDES) \ -c $(filter %.c,$^) -o $@ && \ $(LLVM_STRIP) -g $@ $(OUTPUT)/%.o: %.c | $(OUTPUT) - $(call msg,CC,$@) - $(Q)$(CC) $(CFLAGS) $(INCLUDES) -c $(filter %.c,$^) -o $@ + $(QUIET_CC)$(CC) $(CFLAGS) $(INCLUDES) -c $(filter %.c,$^) -o $@ $(OUTPUT): - $(call msg,MKDIR,$@) - $(Q)mkdir -p $(OUTPUT) + $(QUIET_MKDIR)mkdir -p $(OUTPUT) $(OUTPUT)/vmlinux.h: $(VMLINUX_BTF_PATH) | $(OUTPUT) $(BPFTOOL) - $(call msg,GEN,$@) $(Q)if [ ! -e "$(VMLINUX_BTF_PATH)" ] ; then \ echo "Couldn't find kernel BTF; set VMLINUX_BTF to" \ "specify its location." >&2; \ exit 1;\ fi - $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF_PATH) format c > $@ + $(QUIET_GEN)$(BPFTOOL) btf dump file $(VMLINUX_BTF_PATH) format c > $@ $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(OUTPUT) $(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) \ From patchwork Tue Nov 10 16:43:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 11894843 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCAE3C388F7 for ; Tue, 10 Nov 2020 16:43:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F607207D3 for ; Tue, 10 Nov 2020 16:43:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Z7oG4I5F" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730488AbgKJQnt (ORCPT ); Tue, 10 Nov 2020 11:43:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730108AbgKJQns (ORCPT ); Tue, 10 Nov 2020 11:43:48 -0500 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65799C0613CF for ; Tue, 10 Nov 2020 08:43:48 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id j7so6137360wrp.3 for ; Tue, 10 Nov 2020 08:43:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NRNgSMyFWD2YhO4YUj+TYEJ27Ubp4KzAnhl3fl6mE3k=; b=Z7oG4I5FBgpq+8VxqzkPRhgzTLrviLLrRca2/2msMeqGLRKVc+ZHDnn40JnH+yzS3M gANBvZgOapbZDOlxtVgjhrGJHCejvJvXFKFQeT0bemOqkyC4tSGOQyKWFw2E0SAmWHz4 WDwvJS2pwueJwMCrvbVMpzOEHZwTCsMtHODHdU99tWLmez5eWcsSjdEQo3EU/XX2JTBy DBpg0VcaPMgCZPq1tJTDDad5KQcxOA9Wxva6VaFuVoDlMAATipQhaCruPgnFWWy2caoa PNSXlRMsqOyOmPcnkhcTMGjOMXh4GJzFm3BAntqK6WK7db97RajcqSUYcP085dIpke1E 8eHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NRNgSMyFWD2YhO4YUj+TYEJ27Ubp4KzAnhl3fl6mE3k=; b=E2mBMcplHjc+k1grXShvJC26jfEX20n4eSqNm6S2zJSceYaaMh0wVdbzDcu82n6hW8 maFelbof7YSwYboJaRIZcsluE774cz9kmXDXtfoQmFdH2+I4/ghr1nLgi5/ElbZW22M/ iQgsoSWkoa9XWmIRLVtx1BPdSYrUJzbfxAWVUf9+M8vhSC0/3812gY25NH+Z9FIANGTt s8uzfZEOdxFuv9eI4vt0XrV/B7ilmnAuiik53Q7GRsdxediQyz18C4ZJ5RFwBWWXj/xR NzfNcaWrjMBU6G+8NqXRPyMY651D0A7QYSXks1N2czFbP5HUBmu66JEKDKQ4qM9vJryq t8Vw== X-Gm-Message-State: AOAM531aKLEdTBDgGfQ07eVYpais77fN02bd1B/vP07VI2n8bPcXg92j BUd5lxSN90Oo61eoIh5RU6Dd6w== X-Google-Smtp-Source: ABdhPJw9Qh8/A4cA949YurwKCETh38SZeJUwKdkYu6HYxhzjecjaZs7C9gXC8FZf+OesAnnnT7fWCg== X-Received: by 2002:adf:ebc6:: with SMTP id v6mr23723553wrn.427.1605026627115; Tue, 10 Nov 2020 08:43:47 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id n123sm3272268wmn.38.2020.11.10.08.43.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 08:43:46 -0800 (PST) From: Jean-Philippe Brucker To: ast@kernel.org, daniel@iogearbox.net Cc: bpf@vger.kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, andriin@fb.com, john.fastabend@gmail.com, kpsingh@chromium.org, Jean-Philippe Brucker Subject: [PATCH bpf-next v3 5/7] tools/runqslower: Enable out-of-tree build Date: Tue, 10 Nov 2020 17:43:09 +0100 Message-Id: <20201110164310.2600671-6-jean-philippe@linaro.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201110164310.2600671-1-jean-philippe@linaro.org> References: <20201110164310.2600671-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Enable out-of-tree build for runqslower. Only set OUTPUT=.output if it wasn't already set by the user. Signed-off-by: Jean-Philippe Brucker --- v3: * Drop clean recipe for bpftool and libbpf, since the whole output directories are removed by the clean recipe. * Use ?= for $(OUTPUT) --- tools/bpf/runqslower/Makefile | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/tools/bpf/runqslower/Makefile b/tools/bpf/runqslower/Makefile index bcc4a7396713..0fc4d4046193 100644 --- a/tools/bpf/runqslower/Makefile +++ b/tools/bpf/runqslower/Makefile @@ -1,15 +1,18 @@ # SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) include ../../scripts/Makefile.include -OUTPUT := .output +OUTPUT ?= $(abspath .output)/ + CLANG ?= clang LLC ?= llc LLVM_STRIP ?= llvm-strip -DEFAULT_BPFTOOL := $(OUTPUT)/sbin/bpftool +BPFTOOL_OUTPUT := $(OUTPUT)bpftool/ +DEFAULT_BPFTOOL := $(BPFTOOL_OUTPUT)bpftool BPFTOOL ?= $(DEFAULT_BPFTOOL) LIBBPF_SRC := $(abspath ../../lib/bpf) -BPFOBJ := $(OUTPUT)/libbpf.a -BPF_INCLUDE := $(OUTPUT) +BPFOBJ_OUTPUT := $(OUTPUT)libbpf/ +BPFOBJ := $(BPFOBJ_OUTPUT)libbpf.a +BPF_INCLUDE := $(BPFOBJ_OUTPUT) INCLUDES := -I$(OUTPUT) -I$(BPF_INCLUDE) -I$(abspath ../../lib) \ -I$(abspath ../../include/uapi) CFLAGS := -g -Wall @@ -20,7 +23,6 @@ VMLINUX_BTF_PATHS := /sys/kernel/btf/vmlinux /boot/vmlinux-$(KERNEL_REL) VMLINUX_BTF_PATH := $(or $(VMLINUX_BTF),$(firstword \ $(wildcard $(VMLINUX_BTF_PATHS)))) -abs_out := $(abspath $(OUTPUT)) ifeq ($(V),1) Q = else @@ -38,7 +40,11 @@ runqslower: $(OUTPUT)/runqslower clean: $(call QUIET_CLEAN, runqslower) - $(Q)rm -rf $(OUTPUT) runqslower + $(Q)$(RM) -r $(BPFOBJ_OUTPUT) $(BPFTOOL_OUTPUT) + $(Q)$(RM) $(OUTPUT)*.o $(OUTPUT)*.d + $(Q)$(RM) $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h + $(Q)$(RM) $(OUTPUT)runqslower + $(Q)$(RM) -r .output $(OUTPUT)/runqslower: $(OUTPUT)/runqslower.o $(BPFOBJ) $(QUIET_LINK)$(CC) $(CFLAGS) $^ -lelf -lz -o $@ @@ -59,8 +65,8 @@ $(OUTPUT)/%.bpf.o: %.bpf.c $(BPFOBJ) | $(OUTPUT) $(OUTPUT)/%.o: %.c | $(OUTPUT) $(QUIET_CC)$(CC) $(CFLAGS) $(INCLUDES) -c $(filter %.c,$^) -o $@ -$(OUTPUT): - $(QUIET_MKDIR)mkdir -p $(OUTPUT) +$(OUTPUT) $(BPFOBJ_OUTPUT) $(BPFTOOL_OUTPUT): + $(QUIET_MKDIR)mkdir -p $@ $(OUTPUT)/vmlinux.h: $(VMLINUX_BTF_PATH) | $(OUTPUT) $(BPFTOOL) $(Q)if [ ! -e "$(VMLINUX_BTF_PATH)" ] ; then \ @@ -70,10 +76,8 @@ $(OUTPUT)/vmlinux.h: $(VMLINUX_BTF_PATH) | $(OUTPUT) $(BPFTOOL) fi $(QUIET_GEN)$(BPFTOOL) btf dump file $(VMLINUX_BTF_PATH) format c > $@ -$(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(OUTPUT) - $(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) \ - OUTPUT=$(abspath $(dir $@))/ $(abspath $@) +$(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(BPFOBJ_OUTPUT) + $(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) OUTPUT=$(BPFOBJ_OUTPUT) $@ -$(DEFAULT_BPFTOOL): - $(Q)$(MAKE) $(submake_extras) -C ../bpftool \ - prefix= OUTPUT=$(abs_out)/ DESTDIR=$(abs_out) install +$(DEFAULT_BPFTOOL): | $(BPFTOOL_OUTPUT) + $(Q)$(MAKE) $(submake_extras) -C ../bpftool OUTPUT=$(BPFTOOL_OUTPUT) From patchwork Tue Nov 10 16:43:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 11894835 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E239CC5517A for ; Tue, 10 Nov 2020 16:43:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9289320781 for ; Tue, 10 Nov 2020 16:43:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EVBE0Hm6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730108AbgKJQnu (ORCPT ); Tue, 10 Nov 2020 11:43:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730497AbgKJQnt (ORCPT ); Tue, 10 Nov 2020 11:43:49 -0500 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ED3CC0613CF for ; Tue, 10 Nov 2020 08:43:49 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id d12so11877571wrr.13 for ; Tue, 10 Nov 2020 08:43:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uxXt+eoV5EbJWxm1MIc9HhkqHaHNp9DBdvUyF/Z4TxM=; b=EVBE0Hm6JdPCCZRbh8lQTL2EJJwuNa+lNcEcztmus/TEL44A847jYOO5+p/VnQXs+v fxLiipZ/k6geX/PqudiInJsR8R/s3F0GzxVI2qqRGtdlKjI0zpnwFKLTfqxOCjj9uZjO +Q2Di+nbeF5GwlZ7xDzwKPC2IQV6xkNHXDKQZNlXXis6GHtjK2VbABpIOULS3Zs87YSe iKzY7WviydlXNW0+DqDlEitS6yX7i9XZQi+DqWYYYSJkI4RqqINiaHLcmQeFO7GvDTKY x1GBL23NO43MVpfzY6ga35flWYeQeS36p4fyJft0ueKJT1W4qqm7Qy44goYpc9Zx0ZXx N7mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uxXt+eoV5EbJWxm1MIc9HhkqHaHNp9DBdvUyF/Z4TxM=; b=MqC2JXynO81RNbxrqpqLV7qmGsGepKhs2iBr+llc60XTimvzQRD80WaQtvCUOr0zw/ 5mn/GQbj21oHYwsWK2jP/eJI3iRnniSWIIPbmAHONz1D19e3CcVi2jTPIOo8T6NxDz35 Wp3uEn0F68I8w8tNEugwG7Svl+dRSbIIaMwEcY1y0ifDVgIEOqcMtD771kZQ4AhbODv5 d2lYTEC3UGkaBKRgD65TTs+ADve4rw7FdSALLoHWrPixU0pw827mZFxTaMHiYIDOgGPM iTgC3fZ2A9ZiSVXIlo7VPkFqF1ysWBvKtRHCULnNGlBulScWH6az9sLmsPmHZzE9p65E iuRQ== X-Gm-Message-State: AOAM532eiuXd5Bn5eJWoR+62SmcDXcJcor3hHv963k1PwMTtYL9pjVTg KsjjTBfYGLa8WpIN5iSCmWdVxA== X-Google-Smtp-Source: ABdhPJzn/MH5wfzgqaQAcyDVW/vKku1e9dYNsn++SLuHKTMPgix464tFv8CsM6Bc4CJEbyze51aOUg== X-Received: by 2002:adf:ef48:: with SMTP id c8mr25380591wrp.399.1605026628186; Tue, 10 Nov 2020 08:43:48 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id n123sm3272268wmn.38.2020.11.10.08.43.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 08:43:47 -0800 (PST) From: Jean-Philippe Brucker To: ast@kernel.org, daniel@iogearbox.net Cc: bpf@vger.kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, andriin@fb.com, john.fastabend@gmail.com, kpsingh@chromium.org, Jean-Philippe Brucker Subject: [PATCH bpf-next v3 6/7] tools/runqslower: Build bpftool using HOSTCC Date: Tue, 10 Nov 2020 17:43:10 +0100 Message-Id: <20201110164310.2600671-7-jean-philippe@linaro.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201110164310.2600671-1-jean-philippe@linaro.org> References: <20201110164310.2600671-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net When cross building runqslower for an other architecture, the intermediate bpftool used to generate a skeleton must be built using the host toolchain. Pass HOSTCC and HOSTLD, defined in Makefile.include, to the bpftool Makefile. Signed-off-by: Jean-Philippe Brucker Acked-by: Andrii Nakryiko --- tools/bpf/runqslower/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/bpf/runqslower/Makefile b/tools/bpf/runqslower/Makefile index 0fc4d4046193..4d5ca54fcd4c 100644 --- a/tools/bpf/runqslower/Makefile +++ b/tools/bpf/runqslower/Makefile @@ -80,4 +80,5 @@ $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(BPFOBJ_OU $(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) OUTPUT=$(BPFOBJ_OUTPUT) $@ $(DEFAULT_BPFTOOL): | $(BPFTOOL_OUTPUT) - $(Q)$(MAKE) $(submake_extras) -C ../bpftool OUTPUT=$(BPFTOOL_OUTPUT) + $(Q)$(MAKE) $(submake_extras) -C ../bpftool OUTPUT=$(BPFTOOL_OUTPUT) \ + CC=$(HOSTCC) LD=$(HOSTLD) From patchwork Tue Nov 10 16:43:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 11894845 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19D9EC388F7 for ; Tue, 10 Nov 2020 16:43:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C989B20809 for ; Tue, 10 Nov 2020 16:43:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iYxIhrc+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730018AbgKJQnw (ORCPT ); Tue, 10 Nov 2020 11:43:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730479AbgKJQnu (ORCPT ); Tue, 10 Nov 2020 11:43:50 -0500 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2BF6C0613CF for ; Tue, 10 Nov 2020 08:43:50 -0800 (PST) Received: by mail-wm1-x344.google.com with SMTP id c16so3693288wmd.2 for ; Tue, 10 Nov 2020 08:43:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D6r4PFRYC/yAw5fMVcsDzlSlLBCzPKL22KiXEE0wNo4=; b=iYxIhrc+6XJLC4kM3DU46C9PUL41e3RVJesow/wAHp8WUu/oUd/PknCs6+wdXCP3Mz dH66X+vMBWgxlAj5lRzOzrcEp32H4zly56jpzBmlL1N5+GhxrMuCxS/hg7+DTkTvnQkt cnlrbJHkv2utMcKdAVBsJd5DSM/CkKqbgEamUkzulPiQOwVTqrt/UuxbZzpU1+AM/lg+ FfhAYYz4GaMqb1foaZhpujO3RiHIrZWvWgFARjMjy1Lq2h2Gr+dkzweMgO4PqCdpJi+v JpnwmZhvIhKtTNPlM4fJrG8xDTYMYPxssAwfRz53n3KjV7zN4cFLTR1/Qi4hSgfsYygH 33+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D6r4PFRYC/yAw5fMVcsDzlSlLBCzPKL22KiXEE0wNo4=; b=b05TGcl4nLFASqplTyGDvZgg2HcmkwiqlaaUvWIJPSiRZm5VKYyhLBVKxvTdwHkS2Q qphs3zevmssQFnSQZWvtnU6lGq/s3MEmY6TMVZu88i3cYPt5WAGktv7tKKgxy9k/lguf aL8/dVADcJ4n7RAi64UmNTUjCVTDnPD5NIqANSLuxpvD2smIifXtxIA737rSZYH7XKlm q4wwBSrk99r7KdhgH/EAe0GfVI58DmJwxXQI0xA8p0IRtMBSr328/IRCJFG6m7H6kM6e wySoG8y8TquKnAWK3SY2RY4yTB5BrnEqsJ9ruQa9NIz6kLe4Qli0PJWzkpoH+pcVpKbZ YoGw== X-Gm-Message-State: AOAM531xawx60b8mSqajQWlr1+5bsrbwOtEPZ0DqY8avubf6KBvqs4rA bcaHV2FcjFWDHBDmTLLpYPRH2A== X-Google-Smtp-Source: ABdhPJxg+D0pLAXXLub727WcS7irxL0rJkmPgfXN65yKW2RTUobs0dyUODKmWC5uPpemrzLsA0MpKw== X-Received: by 2002:a1c:7418:: with SMTP id p24mr636537wmc.36.1605026629382; Tue, 10 Nov 2020 08:43:49 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id n123sm3272268wmn.38.2020.11.10.08.43.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 08:43:48 -0800 (PST) From: Jean-Philippe Brucker To: ast@kernel.org, daniel@iogearbox.net Cc: bpf@vger.kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, andriin@fb.com, john.fastabend@gmail.com, kpsingh@chromium.org, Jean-Philippe Brucker Subject: [PATCH bpf-next v3 7/7] tools/bpftool: Fix build slowdown Date: Tue, 10 Nov 2020 17:43:11 +0100 Message-Id: <20201110164310.2600671-8-jean-philippe@linaro.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201110164310.2600671-1-jean-philippe@linaro.org> References: <20201110164310.2600671-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Commit ba2fd563b740 ("tools/bpftool: Support passing BPFTOOL_VERSION to make") changed BPFTOOL_VERSION to a recursively expanded variable, forcing it to be recomputed on every expansion of CFLAGS and dramatically slowing down the bpftool build. Restore BPFTOOL_VERSION as a simply expanded variable, guarded by an ifeq(). Fixes: ba2fd563b740 ("tools/bpftool: Support passing BPFTOOL_VERSION to make") Signed-off-by: Jean-Philippe Brucker Acked-by: Andrii Nakryiko --- v3: new --- tools/bpf/bpftool/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index d566bced135e..804ade95929f 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -30,7 +30,9 @@ LIBBPF = $(LIBBPF_PATH)libbpf.a LIBBPF_BOOTSTRAP_OUTPUT = $(BOOTSTRAP_OUTPUT)libbpf/ LIBBPF_BOOTSTRAP = $(LIBBPF_BOOTSTRAP_OUTPUT)libbpf.a -BPFTOOL_VERSION ?= $(shell make -rR --no-print-directory -sC ../../.. kernelversion) +ifeq ($(BPFTOOL_VERSION),) +BPFTOOL_VERSION := $(shell make -rR --no-print-directory -sC ../../.. kernelversion) +endif $(LIBBPF_OUTPUT) $(BOOTSTRAP_OUTPUT) $(LIBBPF_BOOTSTRAP_OUTPUT): $(QUIET_MKDIR)mkdir -p $@