diff options
author | Paul Fertser <fercerpav@gmail.com> | 2023-01-20 18:25:13 +0300 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2023-03-05 17:48:31 +0100 |
commit | 5a1eb3bb2c27ede3046bb2977008c74a04681db9 (patch) | |
tree | 7a8d882bf98f3d94c8ff64f508c579df1e9989fb | |
parent | 4448b27930526e700d2fcb882bad2fd10aa17918 (diff) | |
download | openwrt-5a1eb3bb2c27ede3046bb2977008c74a04681db9.tar.gz openwrt-5a1eb3bb2c27ede3046bb2977008c74a04681db9.tar.bz2 openwrt-5a1eb3bb2c27ede3046bb2977008c74a04681db9.zip |
Remove ccache wrappers
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 <karlp@etactica.com>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
-rw-r--r-- | rules.mk | 4 | ||||
-rw-r--r-- | tools/ccache/Makefile | 10 | ||||
-rwxr-xr-x | tools/ccache/files/ccache_cc | 2 | ||||
-rwxr-xr-x | tools/ccache/files/ccache_cxx | 2 |
4 files changed, 2 insertions, 16 deletions
@@ -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 25ab4a46ea..6824dbddfd 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 01c4ad42a2..0000000000 --- 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 cc60eb3a13..0000000000 --- a/tools/ccache/files/ccache_cxx +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec ccache "${TARGET_CXX_NOCACHE}" "$@" |