Created attachment 173174 [details] Portmaster output
Sorry for the very sloppy submission. This is FreeBSD 10.3-RELEASE-p4 doing the build with portmaster.
I got the same error. But then compiled fine without CCACHE,
A commit references this bug: Author: jkim Date: Mon Aug 1 23:28:22 UTC 2016 New revision: 419462 URL: https://svnweb.freebsd.org/changeset/ports/419462 Log: Fix build with ccache. PR: 211514 Changes: head/devel/kBuild/Makefile
It should be fixed now (r419462). If it does not work, please let us know.