public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: masahiroy@kernel.org
Cc: linux-kernel@vger.kernel.org, Jiri Slaby <jslaby@suse.cz>,
	Michal Marek <michal.lkml@markovi.net>,
	Nick Desaulniers <ndesaulniers@google.com>,
	linux-kbuild@vger.kernel.org
Subject: [PATCH] scripts: dummy-tools, add pahole
Date: Thu, 14 Apr 2022 11:14:19 +0200	[thread overview]
Message-ID: <20220414091419.7654-1-jslaby@suse.cz> (raw)

CONFIG_PAHOLE_VERSION is a part of a config since the commit below. And
when multiple people update the config, this value constantly changes.
Even if they use dummy scripts.

To fix this:
* add a pahole dummy script returning v99.99 -> 9999
* call it in Makefile taking CROSS_COMPILE into account.

The latter happens only if $(CROSS_COMPILE)pahole really exists. This is
because a cross pahole likely exists only in dummy tools now, not in
real cross tools.

Fixes: 613fe1692377 (kbuild: Add CONFIG_PAHOLE_VERSION)
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: linux-kbuild@vger.kernel.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 Makefile                   | 2 +-
 scripts/dummy-tools/pahole | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100755 scripts/dummy-tools/pahole

diff --git a/Makefile b/Makefile
index ecbd42f3451a..2ef722ba0a41 100644
--- a/Makefile
+++ b/Makefile
@@ -502,7 +502,7 @@ RUSTFMT		= rustfmt
 CLIPPY_DRIVER	= clippy-driver
 BINDGEN		= bindgen
 CARGO		= cargo
-PAHOLE		= pahole
+PAHOLE		= $(if $(wildcard $(CROSS_COMPILE)pahole),$(CROSS_COMPILE)pahole,pahole)
 RESOLVE_BTFIDS	= $(objtree)/tools/bpf/resolve_btfids/resolve_btfids
 LEX		= flex
 YACC		= bison
diff --git a/scripts/dummy-tools/pahole b/scripts/dummy-tools/pahole
new file mode 100755
index 000000000000..53501a36fa71
--- /dev/null
+++ b/scripts/dummy-tools/pahole
@@ -0,0 +1,4 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-only
+
+echo v99.99
-- 
2.35.2


             reply	other threads:[~2022-04-14  9:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14  9:14 Jiri Slaby [this message]
2022-04-14  9:33 ` [PATCH] scripts: dummy-tools, add pahole Masahiro Yamada
2022-04-14  9:42   ` Jiri Slaby
2022-04-14  9:44     ` Jiri Slaby
2022-04-14 15:18       ` Masahiro Yamada
2022-04-19  6:23         ` Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220414091419.7654-1-jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=ndesaulniers@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox