+# Helper functions for logging operations.
+LOG_PFX_LEN = 15
+LOG_PFX_LEN_ADJ = $(LOG_PFX_LEN)
+LOG = $(PRINTF) "$2%$4s$(Color0) $3%s$(Color0)\n" "$1"
+
+CONCISE ?= 0
+ifneq ($(CONCISE),0)
+ # Concise logging puts all logs on the same line (CSI K to clear and
+ # carriage return).
+ LOG = $(PRINTF) "$2%$4s$(Color0) $3%s$(Color0)\033[K\r" "$1"
+endif
+
+_LOG_COMP = $(call LOG,$1,$(ColorC),$(ColorF),$(LOG_PFX_LEN_ADJ))
+_LOG_HOST = $(call LOG,$1,$(ColorH),$(ColorF),$(LOG_PFX_LEN))
+_LOG_HOST_LINK = $(call LOG,$1,$(ColorH),$(ColorLF),$(LOG_PFX_LEN))
+
+# Special operations.
+LOG_LDFILELIST = $(call LOG,LDFILELIST,$(ColorL),$(ColorLF),$(LOG_PFX_LEN_ADJ))
+LOG_MIG = $(call LOG,MIG,$(ColorM),$(ColorF),$(LOG_PFX_LEN_ADJ))
+LOG_LD = $(call LOG,LD,$(ColorL),$(ColorF),$(LOG_PFX_LEN_ADJ))
+LOG_ALIGN = $(call LOG,--------->,$(Color0),$(Color0),$(LOG_PFX_LEN))
+
+# Compiling/machine-specific operations.
+LOG_CC = $(call _LOG_COMP,CC)
+LOG_CXX = $(call _LOG_COMP,C++)
+LOG_AS = $(call _LOG_COMP,AS)
+LOG_LTO = $(call _LOG_COMP,LTO)
+LOG_SYMBOLSET = $(call _LOG_COMP,SYMSET)
+LOG_SYMBOLSETPLIST = $(call _LOG_COMP,SYMSETPLIST)
+
+# Host-side operations.
+LOG_IIG = $(call _LOG_HOST,IIG)
+LOG_HOST_CC = $(call _LOG_HOST,CC)
+LOG_HOST_LD = $(call _LOG_HOST,LD)
+LOG_HOST_CODESIGN = $(call _LOG_HOST,CODESIGN)
+LOG_HOST_BISON = $(call _LOG_HOST,BISON)
+LOG_HOST_FLEX = $(call _LOG_HOST,FLEX)
+LOG_INSTALL = $(call _LOG_HOST,INSTALL)
+LOG_INSTALLSYM = $(call _LOG_HOST,INSTALLSYM)
+LOG_INSTALLHDR = $(call _LOG_HOST,INSTALLHDR)
+LOG_INSTALLMACROS = $(call _LOG_HOST,INSTALLMACROS)
+LOG_INSTALLPY = $(call _LOG_HOST,INSTALLPY)
+LOG_MAN = $(call _LOG_HOST,MAN)
+LOG_MANLINK = $(call _LOG_HOST,MANLINK)
+LOG_ALIAS = $(call _LOG_HOST,ALIAS)
+LOG_STRIP = $(call _LOG_HOST,STRIP)
+LOG_DSYMUTIL = $(call _LOG_HOST,DSYMUTIL)
+LOG_LIBTOOL = $(call _LOG_HOST,LIBTOOL)
+LOG_FILEPREP = $(call _LOG_HOST,FILEPREP)
+
+# Host-side linking operations.
+LOG_GENASSYM = $(call _LOG_HOST_LINK,GENASSYM)
+LOG_GENERATE= $(call _LOG_HOST_LINK,GENERATE)
+LOG_CTFCONVERT = $(call _LOG_HOST_LINK,CTFCONVERT)
+LOG_CTFMERGE = $(call _LOG_HOST_LINK,CTFMERGE)
+LOG_CTFINSERT = $(call _LOG_HOST_LINK,CTFINSERT)
+LOG_DSYMUTIL = $(call _LOG_HOST_LINK,DSYMUTIL)
+LOG_SUPPORTED_KPI = $(call _LOG_HOST_LINK,SUPPORTED_KPI)