Skip to content

Commit

Permalink
common.mk: fix CCACHE handling
Browse files Browse the repository at this point in the history
OP-TEE build system defines the CCACHE variable as the host installed
ccache tool path when ccache is installed [1]. When ccache is not
installed the CCACHE variable is defined as single blank character.
CROSS_COMPILE variable is prefixed with CCACHE as defined in [2].
TF-A v2.11 introduced a build system hardening implying CROSS_COMPILE
must contain the exact toolchain path. For the case when ccache is not
installed, CROSS_COMPILE gets an extra heading space and TF-A build
breaks.
Fix by defining CCACHE only when ccache is effectively installed and
leave CCACHE empty when ccache is not installed.

[1] https://github.com/OP-TEE/build/blob/0c249c77d333c4bdc461650e3bdba5c87a48f0dc/common.mk#L54
[2] https://github.com/OP-TEE/build/blob/b80d8cb05ef6b789e536631f6e8d88118e8483b4/common.mk#L195

Signed-off-by: Olivier Deprez <[email protected]>
Reviewed-by: Jens Wiklander <[email protected]>
Reviewed-by: Jerome Forissier <[email protected]>
  • Loading branch information
odeprez authored and jforissier committed Oct 10, 2024
1 parent 0c249c7 commit 990573e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ WITH_CXX_TESTS ?= y
endif
endif

CCACHE ?= $(shell which ccache) # Don't remove this comment (space is needed)
# Only set CCACHE if it's pointing to something to avoid prefixing CROSS_COMPILE
# with whitespace. TF-A will not build with whitespace first in CROSS_COMPILE.
CCACHE_present := $(shell which ccache)
ifneq ($(CCACHE_present),)
CCACHE ?= $(CCACHE_present) # Don't remove this comment (space is needed)
endif

# QEMU shared folders settings
#
Expand Down

0 comments on commit 990573e

Please sign in to comment.