From patchwork Fri Aug 23 13:48:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 821705 Delivered-To: patch@linaro.org Received: by 2002:adf:e044:0:b0:367:895a:4699 with SMTP id w4csp386126wrh; Fri, 23 Aug 2024 06:49:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXwryDbiykVI8SscKXd4NJObU09uOylhmIzD0RFVu9ZhF00Zd35t+ft7iiyAhECa9hmkwypOg==@linaro.org X-Google-Smtp-Source: AGHT+IG5NjiVQOmKR75LR17UEJtZH/20HHPTEgOdjZUwhWehvAjUJsx9cKoGtBtEFSDIlJ2ezcpm X-Received: by 2002:a5d:494d:0:b0:371:8341:d589 with SMTP id ffacd0b85a97d-3731187e2e3mr1575778f8f.12.1724420956411; Fri, 23 Aug 2024 06:49:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724420956; cv=none; d=google.com; s=arc-20160816; b=TvW7wpLftOPGuOzMn/GtbCKJBNIeQ78gvC9cHH2CP+Z3H9It2Xk6KmQ38D3E2Aipyg TaS/g5iLmh7I/TVzM40n0+bgWQgygZyBpal0Ps9WctILRJPQpJCksb9pdQhqfPigDU0c WHLI8jrsDmef7fKbHoZI2FBvWNW7ot4lo5sKPCyvdlXQ+787jATWr1u1fKoIQrSq1syd I0QEMYk3V97jiYryCfMSydAlpKEk2CmBI3Ceygit33pCO+4Tto9n80oxrxZz9Gfvb4V8 apMrNpOH3tZnUFzjtCUziLPKrqYrZydfjj1EzxZlngvM4H3Iq6jngo5i6CMNybMqblYb W7Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=uOTQNZd1OFEvNEscEUawarENuiq+pq1NNlw8zoOJclY=; fh=TPR6V1FWUdiJK6ron/xUL0r/YP9P50xSS2b+6aCLTvI=; b=mVkMmnC3VP00fzBPu9Qk5A/jeIG38C8WJWesLXfJTeUIJbg7SyhkUQ4Vlq8Oh/sgPR Ra1YC6YwK2PMFZfj4xmDkS8AZxXYjVYEKWmCbNzRY528/c/iMOg98iavMl63RPA/f5L4 KYOlhyPqVZ1n4WKL4b/TyZBtc3mSOxsei0o3RA0EnNpBfVsbfJqr/gjLX0KAJf3VU25Q ALGduNZmB+943PUOGMMOAHdFbpO1GaAQexuteW5QX7tOOi3CKaFO9vqIqnDQcapVHXFR +CVJDVHwgDuM7cS/5hhq5CXV+cCDAOjmstU+MhnuLL6Wd1vcIu6xoAgngRwrn76qpIz3 qV4w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yx8CXJAI; 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 ffacd0b85a97d-373082ad018si1459138f8f.1031.2024.08.23.06.49.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2024 06:49:16 -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=yx8CXJAI; 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 269B5889B4; Fri, 23 Aug 2024 15:49:15 +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="yx8CXJAI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8F71E88965; Fri, 23 Aug 2024 15:49:13 +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-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (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 A895588722 for ; Fri, 23 Aug 2024 15:49:11 +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-x32f.google.com with SMTP id 5b1f17b1804b1-428243f928cso16093315e9.3 for ; Fri, 23 Aug 2024 06:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724420951; x=1725025751; 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=uOTQNZd1OFEvNEscEUawarENuiq+pq1NNlw8zoOJclY=; b=yx8CXJAIb3C4gGVxKqMrP0RS2ux5YhZ9vMzIe19d6z1UuexJBLhoC4JqTCTLoWnjtP 9AGaQ2XyikYsFF5qiSHOgTRPhK54d2ZSHvErUjvWZade5Vpc1RJkKBgdi+Nh4okrNCIq 5w5Qb+1JSMOqk3e3mD9VzDczzL5KtyKv8HYZJvyRHZ9wNtwW81Oy5INGaIndJio34tAQ 5QJ3fH4YpyVxSE5wEa6NPIkJVkBESELQd4Nw28sByMOwYW2rpKS3gMRAtuyOn0Yd6sCE l2orBFLYQhmuGpgVxn06TZvECDjKIPoWOABlVizGQQnHmjKPEBCobUMDj23ysgGAl5Ta k7kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724420951; x=1725025751; 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=uOTQNZd1OFEvNEscEUawarENuiq+pq1NNlw8zoOJclY=; b=H1qIV7yTgowO+rkAfrgDqLFaGod+PbDtVzv+zCmY66EJkToUnLB1zUxlj1iniTOrwL OGroqGjq5gpylcQejrocV42F3p76lYZTXu7tNkA2dTrvf9v4qeRcW+eXzb87CCUPGq1T r+sRge/l5tcUqU4DivVEs5m46L3daSLacknks+Zv5u+twzcycYPmeUDiDo75rX+l2bPQ cqFcmE36UyzY5hiXbF1mre8jaWvA9rzE5K6pVqgpiejgaMT7o1m/UdM3vGRdLm8FuHAT stiItH4FIwHzzPfTky5iMNc3F+0pZblil8uYMF2NGOZPb15qTKf+Ne0oCgBV5sn7vHMh cb/Q== X-Gm-Message-State: AOJu0YxpuBsQil27CKj0ox2YWlscQvOc0lK+klEFLbDsMuRbwvbu7og5 3AFHLhwRTzaIfLxO9FcPZlaVMN9Zhm75Dhf3JhJdwWmTEEv2rqhC3ZgwE47LadYWCEMAMc+EI9G r0E4xgg== X-Received: by 2002:a5d:424a:0:b0:371:93aa:361c with SMTP id ffacd0b85a97d-373118878f6mr1569906f8f.7.1724420950918; Fri, 23 Aug 2024 06:49:10 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:e668:dc94:35c7:8064]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-373081ffb40sm4201665f8f.76.2024.08.23.06.49.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2024 06:49:10 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Javier Tia , Raymond Mao , Maxim Uvarov , Tim Harvey , Anton Antonov , Jerome Forissier , Tom Rini , Simon Glass , Heinrich Schuchardt , Andrew Davis , Sumit Garg , Rasmus Villemoes , Bryan Brattlof , Jesse Taube , "Leon M. Busch-George" Subject: [PATCH v9 01/37] Makefile: detect HOST_ARCH properly when CROSS_COMPILE is multi-word Date: Fri, 23 Aug 2024 15:48:05 +0200 Message-Id: <6ece1bd7ecd90c5396247237cbf26ada63643ca7.1724419624.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 --- 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))