From patchwork Fri Jan 20 15:25:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Fertser X-Patchwork-Id: 1729704 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=tyS3zgrA; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=FnR3jyxa; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nz4nQ1qB1z23gR for ; Sat, 21 Jan 2023 03:33:45 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=He2n6LfkZ3XUfBCUL5EHbGcnE+EXQtdNwzO0QTErW+c=; b=tyS3zgrAswBrZt diRbKpgqD2PBmldJWZ+wa+K45FPSS7wEMyrvfDwhcGucQdpDicxk4DyCCYowWbBLe7Ze23HNeluRj uKWko4XUM20KHFPiMljDVNMrVawlFkgsIcIm8zOElcdmTADl2umqLOmUP5aXr9FTdihwuUKVkaAcm E98Dfu6VH7MtuOoMTxRbnTZIoT3ON9VWqxIEMh/4QgiJgMg5gmb+zWu0ZESGJb94jF7bekvozehqC YLOwp6Em8DN5gOF7X4ro1bhXldzWWrNSR4sr1hbUV58h6UyUfVxSb7qVjT4Ow5SSknIu8fhrjGDGv EvYQimy2T5K7QDkR9h+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIuIb-00BFOe-Lk; Fri, 20 Jan 2023 16:31:29 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pItGq-00Aytb-FV for openwrt-devel@lists.openwrt.org; Fri, 20 Jan 2023 15:25:38 +0000 Received: by mail-ej1-x62b.google.com with SMTP id v6so14840468ejg.6 for ; Fri, 20 Jan 2023 07:25:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=DbqU9/ii3YRT6zlwwsHLh2QI7E8wIeWVbjvmjMhDCyE=; b=FnR3jyxaVRg0La6DgvRBDQBsIfwP6dId2kfBcrNxirVowWpxIJ4ULQtIaH47XZTBlR tGjoQHQNvdA36Dh8Adw5NVyJwZVubdXyXz1ZiwdToS6E8kFJWMZSaNYSpajUNPMoOHRl HKtXCotjMjKmZlJwAECR2F9VhkkMvFWBR04ECsB9xgrLoO8hW4mvE85NoHwXl/VhlfBi 2JZYeFNM2rB3HOKFmL0+fKvC+jns1sU5APEm1K8B7FkEG1Sgwh5fuIGTDQVyirgJEivB 7cJ9I/iZB26WkmJyAKSmarKKp9QwyyzujtWMPBgb/1QSsNjTa3zKDTRIKHx83mHo9nP/ cY5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DbqU9/ii3YRT6zlwwsHLh2QI7E8wIeWVbjvmjMhDCyE=; b=wIhcOhUnO9c2lTeqigZAGuMWGmh9Z+KPHaNcumFU8sGMA2fN7HAyio5d/dstsycGIa LdLKZWGxHjh87WIu6fSZKTaCtTKRyq29UnaNlZMPdBB0HiEEtgS69Z1TM8tnhA+smiUp JlzxjZBSHD9b2WdLtbcvHznCkTITVlP8fBfUZFXyGehu9BeKDD4MCigc1IJI9Fvsty75 WepF9f8AMkXFwuaYuBzr+tOfWqclHDAdep5o9nISIOKD14F+JBEEvrExXIchLJKS8T8M R4ZsMspCiBvKEKw2FeP5hNTavnR6tGuobBMLmcUEurt3G54zkRNVQJAZKGWXpDQkvaly /egQ== X-Gm-Message-State: AFqh2koyE9DRrstorpnjza2m9awQTU5syslpHedT9oAzPhK4k6FJtrPA L/ojW2yVvuuv9wC637PhBPgCyCBQoHo= X-Google-Smtp-Source: AMrXdXv04ic0vnAistkWy1hPUQ0T0zqHLseBFnc4EjLZkmfdzHcbzRE7qz3+w2fTZ9Q4N+h+/2Xfag== X-Received: by 2002:a17:906:3ac5:b0:84d:207d:c00e with SMTP id z5-20020a1709063ac500b0084d207dc00emr15125202ejd.46.1674228333612; Fri, 20 Jan 2023 07:25:33 -0800 (PST) Received: from home.paul.comp (paulfertser.info. [2001:470:26:54b:226:9eff:fe70:80c2]) by smtp.gmail.com with ESMTPSA id k11-20020a1709062a4b00b0073022b796a7sm18370109eje.93.2023.01.20.07.25.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 07:25:33 -0800 (PST) Received: from home.paul.comp (home.paul.comp [IPv6:0:0:0:0:0:0:0:1]) by home.paul.comp (8.15.2/8.15.2/Debian-22) with ESMTP id 30KFPUVh024675; Fri, 20 Jan 2023 18:25:31 +0300 Received: (from paul@localhost) by home.paul.comp (8.15.2/8.15.2/Submit) id 30KFPTcY024674; Fri, 20 Jan 2023 18:25:29 +0300 From: Paul Fertser To: openwrt-devel@lists.openwrt.org Cc: Paul Fertser , Karl Palsson Subject: [PATCH] Remove ccache wrappers Date: Fri, 20 Jan 2023 18:25:13 +0300 Message-Id: <20230120152514.24630-1-fercerpav@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230120_072536_602420_1C220276 X-CRM114-Status: GOOD ( 16.57 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: These wrappers are not needed as CC doesn't need to be a single word. a53b084e497a9f1629a2caada833ebe14a6838b7 which introduced the wrappers doesn't explain why they were really needed and why only for the target and not for the host. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:62b listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [fercerpav[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org These wrappers are not needed as CC doesn't need to be a single word. a53b084e497a9f1629a2caada833ebe14a6838b7 which introduced the wrappers doesn't explain why they were really needed and why only for the target and not for the host. Moreover, name of the wrappers breaks a ccache assumption: since v4.0-3-g6a92b4cd3a67 it has special handling for "chained" invocation such as "ccache ccache gcc" where it skips all the "ccache*" names in the middle and proceeds to run as if it was started as "ccache gcc"[1][2]. This becomes important when a build system sees ccache in the PATH and automatically enables it by prepending to CC. An example of such a system would be autosetup as used by jimtcl. With the wrappers it breaks as the command line ends up being just "ccache -Os..." because "ccache_cc" gets skipped as it starts with "ccache". [1] https://github.com/ccache/ccache/blob/master/src/ccache.cpp#L2105 [2] https://github.com/ccache/ccache/blob/master/src/Util.cpp#L802 Reported-by: Karl Palsson Signed-off-by: Paul Fertser --- I tried CONFIG_ALL=y build and fixed bad packaging where I noticed: https://github.com/openwrt/packages/pull/20353 Also sent a patch for Alpine (in private) and a patch/bug report to libicu upstream: https://github.com/unicode-org/icu/pull/2290 . My notion is that properly fixing affected software is better in the long run. However just renaming the wrappers is an option too if it's much less painful in the end. One potential downside would be that the build systems wouldn't be able to detect e.g. GCC vs clang if used with a wrapper and wouldn't apply custom build flags. rules.mk | 4 ++-- tools/ccache/Makefile | 10 ---------- tools/ccache/files/ccache_cc | 2 -- tools/ccache/files/ccache_cxx | 2 -- 4 files changed, 2 insertions(+), 16 deletions(-) delete mode 100755 tools/ccache/files/ccache_cc delete mode 100755 tools/ccache/files/ccache_cxx diff --git a/rules.mk b/rules.mk index 3d151338af11..a2f5bcca4b0d 100644 --- a/rules.mk +++ b/rules.mk @@ -283,8 +283,8 @@ export HOSTCC_NOCACHE export HOSTCXX_NOCACHE ifneq ($(CONFIG_CCACHE),) - TARGET_CC:= ccache_cc - TARGET_CXX:= ccache_cxx + TARGET_CC:= ccache $(TARGET_CC) + TARGET_CXX:= ccache $(TARGET_CXX) HOSTCC:= ccache $(HOSTCC) HOSTCXX:= ccache $(HOSTCXX) export CCACHE_BASEDIR:=$(TOPDIR) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 25ab4a46eabe..6824dbddfd40 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -28,14 +28,4 @@ ifneq (docs-$(CONFIG_BUILD_DOCUMENTATION),docs-y) CMAKE_HOST_OPTIONS += -DENABLE_DOCUMENTATION=OFF endif -define Host/Install/ccache - $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/ - $(CP) ./files/* $(STAGING_DIR_HOST)/bin/ -endef - -define Host/Install - $(call Host/Install/Default) - $(call Host/Install/ccache) -endef - $(eval $(call HostBuild)) diff --git a/tools/ccache/files/ccache_cc b/tools/ccache/files/ccache_cc deleted file mode 100755 index 01c4ad42a21d..000000000000 --- a/tools/ccache/files/ccache_cc +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec ccache "${TARGET_CC_NOCACHE}" "$@" diff --git a/tools/ccache/files/ccache_cxx b/tools/ccache/files/ccache_cxx deleted file mode 100755 index cc60eb3a13c7..000000000000 --- a/tools/ccache/files/ccache_cxx +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec ccache "${TARGET_CXX_NOCACHE}" "$@"