From d369e47a825d7cbfb5f46a6bc137fc20231dcbf2 Mon Sep 17 00:00:00 2001 From: Changqing Li Date: Fri, 23 Dec 2022 11:38:40 +0800 Subject: [PATCH] base.bbclass: Fix way to check ccache path The previous code had 2 issues: 1. make hosttools/ccache always link to host's ccache (/usr/bin/ccache) even we have one buildtools 2. make hosttools/gcc etc, link to host's gcc event we have one buildtools when keyword ccache in buildtools's path, eg: /mnt/ccache/bin/buildtools This patch is for fix above issues. (From OE-Core rev: 19f6849b161115161c025a0b435229d5097abb9e) Signed-off-by: Changqing Li Signed-off-by: Richard Purdie (cherry picked from commit 1b7c81414cf252a7203d95703810a770184d7e4d) Signed-off-by: Steve Sakoman Signed-off-by: Richard Purdie --- meta/classes/base.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index cb9da78ab6..b15c5839b6 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -132,7 +132,7 @@ def setup_hosttools_dir(dest, toolsvar, d, fatal=True): # /usr/local/bin/ccache/gcc -> /usr/bin/ccache, then which(gcc) # would return /usr/local/bin/ccache/gcc, but what we need is # /usr/bin/gcc, this code can check and fix that. - if "ccache" in srctool: + if os.path.islink(srctool) and os.path.basename(os.readlink(srctool)) == 'ccache': srctool = bb.utils.which(path, tool, executable=True, direction=1) if srctool: os.symlink(srctool, desttool)