diff options
-rw-r--r-- | eclass/freebsd.eclass | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/eclass/freebsd.eclass b/eclass/freebsd.eclass index 57f9d451e0f9..c5d946417de9 100644 --- a/eclass/freebsd.eclass +++ b/eclass/freebsd.eclass @@ -195,6 +195,17 @@ freebsd_src_unpack() { export INSTALL_LINK="ln -f" export INSTALL_SYMLINK="ln -fs" fi + + # When CC=clang, force use clang-cpp #478810, #595878 + if [[ $(tc-getCC) == *clang* ]] ; then + if type -P clang-cpp > /dev/null ; then + export CPP=clang-cpp + else + mkdir "${WORKDIR}"/workaround_clang-cpp || die "Could not create ${WORKDIR}/workaround_clang-cpp" + ln -s "$(type -P clang)" "${WORKDIR}"/workaround_clang-cpp/clang-cpp || die "Could not create clang-cpp symlink." + export CPP="${WORKDIR}/workaround_clang-cpp/clang-cpp" + fi + fi } freebsd_src_compile() { |