Index: lib/Makefile =================================================================== --- lib/Makefile +++ lib/Makefile @@ -183,8 +183,8 @@ ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "i386" || \ ${MACHINE_CPUARCH} == "powerpc") _libclang_rt= libclang_rt -.elif ${MK_ASAN} != "no" || ${MK_UBSAN} != "no" -.error "Requested build with sanitizers but cannot build runtime libraries!" +.elif (${MK_ASAN} != "no" || ${MK_UBSAN} != "no") && .make(all) +.error Requested build with sanitizers but cannot build runtime libraries! .endif .if ${MK_CXX} != "no" Index: share/mk/bsd.sanitizer.mk =================================================================== --- share/mk/bsd.sanitizer.mk +++ share/mk/bsd.sanitizer.mk @@ -23,7 +23,7 @@ .endif # ${MK_UBSAN} == "yes" .if !defined(BOOTSTRAPPING) && ${_use_sanitizers} != "no" && \ - ${COMPILER_TYPE} != "clang" + ${COMPILER_TYPE} != "clang" && .make(all) .error "Sanitizer instrumentation currently only supported with clang" .endif