diff --git a/lib/Makefile b/lib/Makefile --- a/lib/Makefile +++ b/lib/Makefile @@ -176,10 +176,9 @@ SUBDIR.${MK_LDNS}+= libldns SUBDIR.${MK_STATS}+= libstats -# The libraries under libclang_rt can only be built by clang, and only make -# sense to build when clang is enabled at all. Furthermore, they can only be -# built for certain architectures. -.if ${COMPILER_TYPE} == "clang" && \ +# The libraries under libclang_rt can only be built by clang and when we enable +# C++ support. Furthermore, they can only be built for certain architectures. +.if ${COMPILER_TYPE} == "clang" && ${MK_CXX} != "no" && \ (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "i386" || \ ${MACHINE_CPUARCH} == "powerpc")