[Skiboot] [PATCH v2 1/2] Makefile: Fix detection of cross compiler

Joel Stanley joel at jms.id.au
Tue Mar 8 12:45:42 AEDT 2022


The Fedora containers don't have 'which' installed. This means the
detection of the cross compiler gives false negatives, leaving CROSS
undefined.

Instead use command -v, which outputs the path of the executable if it
exists.

Fixes: 9cd556ca1e5f ("Makefile: Search for distro-provided cross-compiler")
Signed-off-by: Joel Stanley <joel at jms.id.au>
---
 Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 625f212eaa99..f3942c442a84 100644
--- a/Makefile
+++ b/Makefile
@@ -16,13 +16,13 @@ ifdef CROSS_COMPILE
 endif
 ifneq ("$(ARCH)", "ppc64")
 ifneq ("$(ARCH)", "ppc64le")
-ifneq ($(shell which powerpc64-linux-gcc 2> /dev/null),)
+ifneq ($(shell command -v powerpc64-linux-gcc 2> /dev/null),)
 	CROSS ?= powerpc64-linux-
-else ifneq ($(shell which powerpc64le-linux-gcc 2> /dev/null),)
+else ifneq ($(shell command -v powerpc64le-linux-gcc 2> /dev/null),)
 	CROSS ?= powerpc64le-linux-
-else ifneq ($(shell which powerpc64-linux-gnu-gcc 2> /dev/null),)
+else ifneq ($(shell command -v powerpc64-linux-gnu-gcc 2> /dev/null),)
 	CROSS ?= powerpc64-linux-gnu-
-else ifneq ($(shell which powerpc64le-linux-gnu-gcc 2> /dev/null),)
+else ifneq ($(shell command -v powerpc64le-linux-gnu-gcc 2> /dev/null),)
 	CROSS ?= powerpc64le-linux-gnu-
 endif
 endif
-- 
2.34.1



More information about the Skiboot mailing list