[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210409095306.738255512@linuxfoundation.org>
Date: Fri, 9 Apr 2021 11:54:07 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Jiri Olsa <jolsa@...nel.org>,
Andrii Nakryiko <andrii@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.11 41/45] kbuild: Do not clean resolve_btfids if the output does not exist
From: Jiri Olsa <jolsa@...nel.org>
[ Upstream commit 0e1aa629f1ce9e8cb89e0cefb9e3bfb3dfa94821 ]
Nathan reported issue with cleaning empty build directory:
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** \
O=/ho...build/tools/bpf/resolve_btfids does not exist. Stop.
The problem that tools scripts require existing output
directory, otherwise it fails.
Adding check around the resolve_btfids clean target to
ensure the output directory is in place.
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Signed-off-by: Andrii Nakryiko <andrii@...nel.org>
Tested-by: Nathan Chancellor <nathan@...nel.org>
Link: https://lore.kernel.org/bpf/20210211124004.1144344-1-jolsa@kernel.org
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
Makefile | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index a135a7b9d265..250b4e58abbc 100644
--- a/Makefile
+++ b/Makefile
@@ -1084,8 +1084,14 @@ endif
PHONY += resolve_btfids_clean
+resolve_btfids_O = $(abspath $(objtree))/tools/bpf/resolve_btfids
+
+# tools/bpf/resolve_btfids directory might not exist
+# in output directory, skip its clean in that case
resolve_btfids_clean:
- $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(abspath $(objtree))/tools/bpf/resolve_btfids clean
+ifneq ($(wildcard $(resolve_btfids_O)),)
+ $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean
+endif
ifdef CONFIG_BPF
ifdef CONFIG_DEBUG_INFO_BTF
--
2.30.2
Powered by blists - more mailing lists