From patchwork Mon Nov 11 13:20:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 2009814 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xn9DD6S6vz1xyB for ; Tue, 12 Nov 2024 00:21:16 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5EE6988EBB; Mon, 11 Nov 2024 14:21:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 1021188EC9; Mon, 11 Nov 2024 14:21:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-bc0a.mail.infomaniak.ch (smtp-bc0a.mail.infomaniak.ch [IPv6:2001:1600:4:17::bc0a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 04D7088A0A for ; Mon, 11 Nov 2024 14:21:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=foss+uboot@0leil.net Received: from smtp-3-0001.mail.infomaniak.ch (smtp-3-0001.mail.infomaniak.ch [10.4.36.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4Xn9D048R9zc4V; Mon, 11 Nov 2024 14:21:04 +0100 (CET) Received: from unknown by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4Xn9Cz69hYz6X3; Mon, 11 Nov 2024 14:21:03 +0100 (CET) From: Quentin Schulz Date: Mon, 11 Nov 2024 14:20:49 +0100 Subject: [PATCH] Makefile: fix empty MK_ARCH when using ccache MIME-Version: 1.0 Message-Id: <20241111-mk_arch-ccache-v1-1-e27f5f605bc4@cherry.de> X-B4-Tracking: v=1; b=H4sIALAEMmcC/x2MQQqAIBAAvxJ7TlAxkr4SEbJtuUQWChGEf29pb nOYeaFQZiowNC9kurnwmURM2wDGkDZSvIiD1dYZQR37HDJGhRgwkupNp523uC7kQaIr08rPPxy nWj9EUeQRYAAAAA== X-Change-ID: 20241111-mk_arch-ccache-7150482cfde8 To: Tom Rini Cc: Simon Glass , Heinrich Schuchardt , u-boot@lists.denx.de, Quentin Schulz X-Mailer: b4 0.14.2 X-Infomaniak-Routing: alpha 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 From: Quentin Schulz One can use ccache by prefixing the typical CROSS_COMPILE value with "ccache " (e.g. "ccache aarch64-gnu-linux-" for Aarch64). This however makes the MK_ARCH empty because sed won't find a match anymore since it expects the CROSS_COMPILE value to start with the actual toolchain (with an unlimited number of white spaces before). This is failing builds since commit 7506c1566998 ("sandbox: Report host default-filename in native mode"). Add "ccache" prefix to ignore but participate in the matching regex used by sed to identify the target architecture. Signed-off-by: Quentin Schulz --- One can use ccache by prefixing the typical CROSS_COMPILE value with "ccache " (e.g. "ccache aarch64-gnu-linux-" for Aarch64). This however makes the MK_ARCH empty because sed won't find a match anymore since it expects the CROSS_COMPILE value to start with the actual toolchain (with an unlimited number of white spaces before). This is failing builds since commit 7506c1566998 ("sandbox: Report host default-filename in native mode"). Add "ccache" prefix to ignore but participate in the matching regex used by sed to identify the target architecture. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: 9c25cd563179cf32cf3b119d5ae78ef8348d0335 change-id: 20241111-mk_arch-ccache-7150482cfde8 Best regards, diff --git a/Makefile b/Makefile index 7275a02f24ca64ebd46c5dc6e769dcdee9917dca..71743db16fca930567edd67eb77f1c94e9b7b4e9 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 $(CROSS_COMPILE) | sed -n 's/^\(ccache\)\?[[:space:]]*\([^\/]*\/\)*\([^-]*\)-[^[:space:]]*/\3/p'}" endif unexport HOST_ARCH ifeq ("x86_64", $(MK_ARCH))