From patchwork Fri Aug 30 10:16:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 823963 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp700758wrs; Fri, 30 Aug 2024 03:17:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWpCGaLwBl5NAB8ghT5uSn4Xbx8LxWlMW0hmFS4hYwiXy8MqqYzFTfLZv8uxeaoJT5wdxGbAQ==@linaro.org X-Google-Smtp-Source: AGHT+IFYEczUaWPki+1kWU44FYpziVOzpbKuEhUDmK17UhPkznVRDx+bWg3tleTeE1yjNa9pb3aD X-Received: by 2002:adf:f346:0:b0:368:3f13:22fe with SMTP id ffacd0b85a97d-374a9598b6amr1103075f8f.23.1725013058861; Fri, 30 Aug 2024 03:17:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725013058; cv=none; d=google.com; s=arc-20240605; b=GKnKmkaShTdCj41M1IH5K39FM0HM9aRyjUtiUXAwS9tvXd+XzHbb4D+6pGirMx/BHC OOsSYGbei4TV80rO8cghuI+oJbu87PLs+dR7H4Xf3fi6MjqgsYZxxQCRi2bpL6aFAGqh YA04mMr+53SPl/dOxfOECdPb+0yrv8BeENBKQUUTgaIdSyZ4P+l+k69CXh4ZzwcuOFm1 tBiv/df5lGtjolZv9LM6gelrpRCcaGvGAzQSn3RDM4qdFAjvbS8pyP75WAiEG2jUsAhK DoPmwAPAvakGn0eWnZETnTjDI3lXoqepp+zhrmJb97kWHNZ5W/qMRWdJbNGhFO81kik+ Emvw== 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=S0RBhVoNaek3QAHuKn+tz7pK4sQBIpxCfm7RmAzgMQ8=; fh=eDZQStCr7QM0v5EyQOWkbrllOW6Qai20rcA/vvByphE=; b=li8rWD24Fq5OvQrZb7C8xQk/+wbJTSYF0jM9TogoP7dy+p4ysyNNux7WB1VaUi28gl GZvEQKp7vbImNAcy7bqNuzgBkQ8TMthR/sYB8K3rHf6zKwU518amPwL408BP946BbR/u PHYGE5GsLer+5jbU6E5h6U3ttdchJ8spYN1RY28mNpLK118rTRj06rX1jjKnjxtwQvAP iJBzT4fF5qazXUb04+362qYbQXQXpp+L5UTNJbTAkmshdXWYCHh01v8Z703aAEWIZUl2 E1zSyCiDE8y8KV35Z63caVdp8Afm/qhBNrBaFeaYfnZMeAZp34bs4Jwlc0XeLfBK4G6z GK8g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aMhzyAwn; 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 4fb4d7f45d1cf-5c226c7216dsi2682049a12.76.2024.08.30.03.17.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 03:17:38 -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=aMhzyAwn; 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 3921F8897B; Fri, 30 Aug 2024 12:17:26 +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="aMhzyAwn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 68CFE8817C; Fri, 30 Aug 2024 12:17:24 +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-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (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 812B988744 for ; Fri, 30 Aug 2024 12:17:22 +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-x42e.google.com with SMTP id ffacd0b85a97d-371a92d8c90so961236f8f.3 for ; Fri, 30 Aug 2024 03:17:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725013042; x=1725617842; 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=S0RBhVoNaek3QAHuKn+tz7pK4sQBIpxCfm7RmAzgMQ8=; b=aMhzyAwnvmFH2/aanplGhMTeSxuP+JiNbyk6VY2I9XWSRC23nZSmRrYVDC2oc/z4Cg O75hoNh8uszWx+hzLsg1XP+WCSYrwiB4xnhZEcfAlaEofSGm4w9QpZQWCglcsRafmEx2 9yUFJwXMeczR+GzqO5zrOZeE8AphkIpSf002mOX1eBd/Ld0YtkoVePcu7bdbBfE46riG gJwl4NZrCy2OLxK8alwk1veOidOYgctXaHJf4WGEZUBwCcUNmyLJ7+0tsiW2onsp6QZI M8znomz/E6uAPaXD2J7HcshAxI4tb/0W8a7apG7dKkwZz62F+PaisgP2BwBl9hXjOyzq EyJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725013042; x=1725617842; 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=S0RBhVoNaek3QAHuKn+tz7pK4sQBIpxCfm7RmAzgMQ8=; b=pf4+8w2f9hiJSjEE75w2hV4G1WVJhuKJuBTKxx5P2GMdlJWm/Y7k73YONxO9GPGDp+ cu6l0j9rLurJVLWuocHSsaDwdRcv4h6FOQ6mMPQPfKmE1X/hLSXioAxI3Vt4wxNsJdOR ZkkNoUPfITvbiXRFCVQw8W9Jqagil5CZ7kEkjrnTlpIzM4960QJTGN5l+DWCwNFndjaC EuqIHOKoWiz6yPt3nc6bJN+Wx293V5OLREPuqC0gg450TIFXO4c1nDt+Sni85Q+CuSko h7VG3uP55I+ILx3l28Z+LM0kU4nLx2jPRuf0aWx+NkKjU0VcFqVLv8yFSVCMESDFLPYh JdaQ== X-Gm-Message-State: AOJu0YwfBL6OkTur13QJjPXxc4/cxkH71GbaQNI8JHCT7Nx0JlJJdUPz dCn8N3yzz3U1UcPNsmeg7vGsTowhJs2QS6i/ZtTc38AI5wHQVURY/St1pxNRDEXQ0G3WyYRnI3Y wAk3Ylw== X-Received: by 2002:a5d:6605:0:b0:374:959a:780a with SMTP id ffacd0b85a97d-374a9677377mr969434f8f.57.1725013041684; Fri, 30 Aug 2024 03:17:21 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6417:8cf6:a7f7:ee38]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-374b6a3d27fsm472728f8f.59.2024.08.30.03.17.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 03:17:21 -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 , Andrew Davis , Sumit Garg , Bryan Brattlof , Jesse Taube , "Leon M. Busch-George" Subject: [PATCH v2 01/16] Makefile: detect HOST_ARCH properly when CROSS_COMPILE is multi-word Date: Fri, 30 Aug 2024 12:16:44 +0200 Message-Id: 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: Peter Robinson 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))