From patchwork Tue Sep 3 08:37:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 824876 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp2297732wrs; Tue, 3 Sep 2024 01:39:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXy0RYoL2kSVgv21T5Xsd5+RdTs1gy55Y1igr8VUHw8J4Cjtpm5KDGey38rAhlSbMDS573i9A==@linaro.org X-Google-Smtp-Source: AGHT+IFx6FIcJw3NJjai+pjTvOvB4ma6sBv40SbsnWRFJ5qorA6f4wqBYy+puKw1JXdogAt7v8Gm X-Received: by 2002:a17:906:c14b:b0:a72:b4d6:ec6c with SMTP id a640c23a62f3a-a89b955a9cemr684927066b.33.1725352741896; Tue, 03 Sep 2024 01:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725352741; cv=none; d=google.com; s=arc-20240605; b=Dx8oOQ9Yb6qMBAjeo5YmLGCIYshSzfQhCN1nn4bQngdFnSaYMDfLqW5kJK876YM4D2 Lzbn9236jFaf6IBC0IOxrfaO4bcOqO0BJjUXC7wm8ITygofuwV7N/LuxWcp3XLvOFHiK K0DG6VsjXihR7ihqkUjyXfY+QgwlnZ1Ir2lnhiYXsyfYYkSN1TC9v27h+0OwXQbrmdpp NwpF4lBawePS6MZnru59yX1I82WkahhSicE4u/GGLbSzrUkaNq2In0MsThWfDcShxDQ/ aFgs1aUfUY8kdmDlm0ZkNQSJlHBC8+aGAslzEPIJ/bueMb/u0bs3J7N5Ij4DFAd4DSLj bLkQ== 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=fE83AK41qas/C5KrJhvshI8YbnBfo8bqWhSX5ugB1gI=; fh=fel16blFnBofjPNXe2Cz3Kf/hr1z/DvTbb9IdGYQ0Do=; b=GU/XjmMfS4bYb4mLufdmzlhvg3Dkx0QyVw5ZCbZ0O3VaEaXM0b/jdHwuuoafWLFFx2 rrNKw26/d6B8OeIV/VqVJKOiJrkfQRdfCi+Gb3Kti/kdVem86A02n0EMUPVsEcFNA7zm U/N0L32vgXI69hEyF5XQ4Ta/RfqnyODMiVgfEHRUF+V7l4aw7DaUhF9hNcLNnC1Vkqx8 DdyWKR9vbDMJld8YphVsH0AVPyEUxoJMGhvPUDZt88YD3MfP/q1xR/w8WK7nZ4IHR1Ot G2xtC961M8v0vRqq2tu58259RbtUE9liuiYn0rML/lbrEXF1tzyoVxqzcJPOm6ZXEl7b iPGg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ed9qz9m6; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id a640c23a62f3a-a8988fb8ff1si856717266b.259.2024.09.03.01.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:39:01 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ed9qz9m6; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 5B07788C6F; Tue, 3 Sep 2024 10:38:50 +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="ed9qz9m6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 734C888C1C; Tue, 3 Sep 2024 10:38:49 +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-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (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 8527F88C19 for ; Tue, 3 Sep 2024 10:38: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=jerome.forissier@linaro.org Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-42c7a384b18so22266475e9.0 for ; Tue, 03 Sep 2024 01:38:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725352726; x=1725957526; 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=fE83AK41qas/C5KrJhvshI8YbnBfo8bqWhSX5ugB1gI=; b=ed9qz9m6wMpHbuQBntma/v/UdMMrKzeBqJkfdGrDZXMd1+/U4jRKmCVDDGhN3m9GIJ S+28+rKG4dx4RoVBlLRuPGrmI+ZWi2s8tW1Fsg6F3LYIwjRzaP70P+/C/IXBiDq7L9pd OzRvTc4LvAJ00dsjH9CQNims81/VuRJJsZ0U3q6Q12FfvPzrG6IpS3Q9PI2UJqGYJraz 3OyAixYMBH/MuHboWZwq3vbIjV8Lg4XzEb8SbsUdLUwG1eefIxq4Us68DQk3Af0URRUw vElxIM1XIDBiDK1BvKx0Xl3L7ATR7NEtqOEDqBnEvqRNoNiYc8+1ggbdfS0boj1ZDw4T 4Qrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352726; x=1725957526; 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=fE83AK41qas/C5KrJhvshI8YbnBfo8bqWhSX5ugB1gI=; b=vyl1BdHuwiQUVae3DPykjN243c7Tycwa8kGyFgyETa/UcKM69IFTqnTjiWv3JX0Q0R 3fpPqQRBCB97GaLo4blXcs4HWLK1+J4t5WSb9EjpgQG7XpvDdihEVJhzmuRYo7AW19nB nqdlkRmBSCs2+pqA6ra6Xl79Hf9mxD1bCNbkSCbYBO4Nmt2Ed2a586TAMC87MkR0dIYv I6PBH6IW3KLBmUluj4E9qlJbf0Ec0v94YjGouizjp51fR6nD1qkD9MzuU5yLXaiaBdYL not31oXBVojU+j1jTaHxNtCCMw4QZShKPTyZ88LrAx4FjGkKqfKOMdICrnE3f1kXUu1l HEPw== X-Gm-Message-State: AOJu0Ywgd7K7fe1poX2MJBFXp/Htnww328Jw9tf/ma9pc8Q/Z5Mbjw75 gulqPIOnrLF8oPDZamtWbaRtUOCsX5rrRp9me0ncIBgNwNGICWBySyvjmB32UDA7vpytfJh451C wdOzQUg== X-Received: by 2002:a05:600c:1c1a:b0:426:593c:935f with SMTP id 5b1f17b1804b1-42bd731ee1bmr59489005e9.1.1725352726366; Tue, 03 Sep 2024 01:38:46 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6417:8cf6:a7f7:ee38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6df795asm163103325e9.21.2024.09.03.01.38.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:38:45 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Peter Robinson , Jerome Forissier , Tom Rini , Simon Glass , Heinrich Schuchardt , Sumit Garg , Andrew Davis , Rasmus Villemoes , Bryan Brattlof , Jesse Taube , "Leon M. Busch-George" Subject: [PATCH v3 01/16] Makefile: detect HOST_ARCH properly when CROSS_COMPILE is multi-word Date: Tue, 3 Sep 2024 10:37:58 +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 Reviewed-by: Peter Robinson --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f90e48f58a5..dc7bdd79420 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))