diff --git a/lib/Makefile b/lib/Makefile --- a/lib/Makefile +++ b/lib/Makefile @@ -180,7 +180,8 @@ SUBDIR.${MK_STATS}+= libstats # The libraries under libclang_rt can only be built by clang. -.if ${COMPILER_TYPE} == "clang" && ${MK_CLANG} != "no" +.if (${COMPILER_TYPE} == "clang" || make(clean) || make(cleandir)) && \ + ${MK_CLANG} != "no" _libclang_rt= libclang_rt .elif (${MK_ASAN} != "no" || ${MK_UBSAN} != "no") && make(all) .error Requested build with sanitizers but cannot build runtime libraries!