From patchwork Wed Aug 28 12:10:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 823149 Delivered-To: patch@linaro.org Received: by 2002:adf:f4c1:0:b0:367:895a:4699 with SMTP id h1csp754262wrp; Wed, 28 Aug 2024 05:10:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVORQxJhIRBcUwEIUncwjKqKO0iWCnTEcJUOhsYQ79uPwPdjzxZhxOvPNA8cJuNytcWvAh6ig==@linaro.org X-Google-Smtp-Source: AGHT+IGHaz1gU+mWYLz3sgolICP5yps6LN/VGML9jShBza5ibhSvYkSmb9XPMBjN1hWoEfn7v6WI X-Received: by 2002:a05:651c:98d:b0:2f2:b5c6:ccca with SMTP id 38308e7fff4ca-2f5232906bcmr7709481fa.14.1724847055197; Wed, 28 Aug 2024 05:10:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724847055; cv=none; d=google.com; s=arc-20240605; b=jvuw6TJ9wZBGDpOoRmvN7TW5HWSD36jAmPS5JflBv7yp7fIbqRj4bTzBxjIh9HgBs3 WXaxwEm/NCnk9BPGxdsHOBuJbhk8AqZe23Jk3Q5QGsoN+LXSK/SN/BwhD5lK+9ue19NA wst+lRv00AyrzWbGQB1P2B/b4JnA8OTpGnY9f1T9+7JVMYUIMk4OuQWMtxDL6Il8CcUs bTNPYPDj73KcmFlqu/ousNzVUxK9ECA77X+vupSCSGa7S7vo6hkKPdLD0tZO/B7SIKnJ 4Frrhn84SBu0696BP2UCGVqdoumt9QjL0AvNRMKo1Gppe9VpBdfkAnBFp7HP+AFCRuNK lj5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=p6H6IWdSN+rg+rHMHDRzq1nSIiOPpJHDMNLUt1yZPnk=; fh=x2iUDOXIsW0/UeucAQbo+smMu29+HewZ7ctDX8/icfs=; b=CgixZXm8tMj9aJpzVqufP2G6Zls6Av0pepxZFSzLITIk58LF4sz1gHxskkDczCQhnq GVIK4qqofNy40PCRNmOSl+H2Jx46yMbJUyaf3WEY1n4LK9stXCfGMSrqyr6R9UDiNW57 n5sWKJ6ydy3JnGlSraf3ey5q0+WDzZXZFhibTiETAQgJ/O8h4Q4pfXC9xSN4IzBx0Z5P iP0/CF4tC0kKwVRMXyQqoa93O9II0ixeNQ9sdazOgrwQZn3ggruvzqYr0q9K87IQxpPa UHA2o7UWeCXtA5JhLBEYKw+qGXMcCJYcMLAM7eMrABcC+4erT1YX/KUssff25fHUihkX 5Z2w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QTFz+oj0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f404869aa1si43892981fa.244.2024.08.28.05.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2024 05:10:55 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QTFz+oj0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 31A3488A76; Wed, 28 Aug 2024 14:10:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="QTFz+oj0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A051388829; Wed, 28 Aug 2024 14:10:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BA25588847 for ; Wed, 28 Aug 2024 14:10:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-371a13c7c80so354622f8f.0 for ; Wed, 28 Aug 2024 05:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724847042; x=1725451842; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p6H6IWdSN+rg+rHMHDRzq1nSIiOPpJHDMNLUt1yZPnk=; b=QTFz+oj0uB/nz9NgA3qF5EbQ7RqAaDr1uhJRuzzMhlc2/J+5L/m3i0Z4eFXdgPo089 ssnu+qZgNY05ZPQJrk8J+WyZGy/Bn5R05W7L69guDgjliq9LJf0t4oZP+7FKaC3HUbyq ovdQYWhVJHE43iD5EtVq9eh0HBoCQozwxRq6eXPNM9yXMdXTmo6Katru/v/SFnwL5hbT kJxlhDF7ef5S+SAZd5xxmg6yXjOCYtBurtfKbALroHcFzP4IxjSNlIu39jKFqUh7djLM 9emfsyAOwQ+ZRso4UwbD5HxdWZ3VZR3edGeIQ0hCm1GNnRVbwqVJg5O7TJeMrFD4evEP p4Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724847042; x=1725451842; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p6H6IWdSN+rg+rHMHDRzq1nSIiOPpJHDMNLUt1yZPnk=; b=SeCRC8yfm4ISZi4FdWAtd6ui7rcyGR6V6aOyNMM9STA2fbHqM6e3dhd/b/h17S8ID/ Xb2YCItJF9IE1lATQR4gP4sRRZ0S51uo+zjmcZILidY+X34MI0JbHzmp9TR96J5LxOTb TA6badKRFfVNc3//UVI5CyubX4/ObGJ9kj2B+iLd+Q6vTz/XHnlSCUEWRyVK5HMecwBs u8wbTBo2P3RftjzuXTVEWWxqylWiHGxr2G/QhOWhXkicGrGCPihhq74z1bGiLbpew3PF FqJtvDYyU3HLZKMKquORvvjXY3NSZh1EE1Z7dlhp6QF5oaicOp/ble9QN3dZinSMoxkt nIkA== X-Gm-Message-State: AOJu0YzN5d1XD3QBIgNMy6o4HKooLJhf3Mfc50T1VPUAC4HSaRyVTZtd dvzzTCVzvXulj0pJskxyNBWznGAUO7w3ZP4YhUheAb91FXxdnnAjlOsiw9IL6vLn8FgjNX/offY FSmBTtg== X-Received: by 2002:a05:6000:1142:b0:366:dee6:a9ea with SMTP id ffacd0b85a97d-37495f74970mr1115246f8f.26.1724847041858; Wed, 28 Aug 2024 05:10:41 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:8ac3:aada:f033:985a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ba639687csm19470365e9.8.2024.08.28.05.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2024 05:10:41 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Peter Robinson , Jerome Forissier , Tom Rini , Simon Glass , Heinrich Schuchardt , Rasmus Villemoes , Sumit Garg , Andrew Davis , Bryan Brattlof , Jesse Taube , "Leon M. Busch-George" Subject: [PATCH 01/13] Makefile: detect HOST_ARCH properly when CROSS_COMPILE is multi-word Date: Wed, 28 Aug 2024 14:10:24 +0200 Message-Id: <7de6a75453d11fa56ae81f3ad3d0f16f0d12546e.1724846454.git.jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean When CROSS_COMPILE contains multiple words, HOST_ARCH is not properly detected and the sandbox build fail. It typically happens when using ccache. For example: $ make sandbox_defconfig $ make CROSS_COMPILE="ccache x86_64-linux-gnu-" \ CC="ccache x86_64-linux-gnu-gcc" [...] In file included from boot/bootmeth_efi.c:16: include/efi_default_filename.h:33:2: error: #error Unsupported UEFI architecture 33 | #error Unsupported UEFI architecture | ^~~~~ A similar error occurs when the build is done via buildman and ~/.buildman contains: [toolchain-wrapper] wrapper = ccache Fix the issue by considering only the last word in $(CROSS_COMPILE). Signed-off-by: Jerome Forissier Reviewed-by: Ilias Apalodimas --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f90e48f58a..dc7bdd7942 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ include include/host_arch.h ifeq ("", "$(CROSS_COMPILE)") MK_ARCH="${shell uname -m}" else - MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^[[:space:]]*\([^\/]*\/\)*\([^-]*\)-[^[:space:]]*/\2/p'}" + MK_ARCH="${shell echo ${lastword $(CROSS_COMPILE)} | sed -n 's/^[[:space:]]*\([^\/]*\/\)*\([^-]*\)-[^[:space:]]*/\2/p'}" endif unexport HOST_ARCH ifeq ("x86_64", $(MK_ARCH))