Changeset View
Changeset View
Standalone View
Standalone View
share/mk/bsd.sanitizer.mk
Show All 17 Lines | |||||
# code for now. | # code for now. | ||||
SANITIZER_CFLAGS+= -fsanitize=undefined | SANITIZER_CFLAGS+= -fsanitize=undefined | ||||
SANITIZER_CFLAGS+= -fsanitize-recover=undefined | SANITIZER_CFLAGS+= -fsanitize-recover=undefined | ||||
SANITIZER_LDFLAGS+= -fsanitize=undefined | SANITIZER_LDFLAGS+= -fsanitize=undefined | ||||
_use_sanitizers= yes | _use_sanitizers= yes | ||||
.endif # ${MK_UBSAN} == "yes" | .endif # ${MK_UBSAN} == "yes" | ||||
.if !defined(BOOTSTRAPPING) && ${_use_sanitizers} != "no" && \ | .if !defined(BOOTSTRAPPING) && ${_use_sanitizers} != "no" && \ | ||||
${COMPILER_TYPE} != "clang" | ${COMPILER_TYPE} != "clang" && make(all) | ||||
.error "Sanitizer instrumentation currently only supported with clang" | .error "Sanitizer instrumentation currently only supported with clang" | ||||
.endif | .endif | ||||
# For libraries we only instrument the shared and PIE libraries by setting | # For libraries we only instrument the shared and PIE libraries by setting | ||||
# SHARED_CFLAGS instead of CFLAGS. We do this since static executables are not | # SHARED_CFLAGS instead of CFLAGS. We do this since static executables are not | ||||
# compatible with the santizers (interceptors do not work). | # compatible with the santizers (interceptors do not work). | ||||
.if ${_use_sanitizers} != "no" | .if ${_use_sanitizers} != "no" | ||||
.include "../../lib/libclang_rt/compiler-rt-vars.mk" | .include "../../lib/libclang_rt/compiler-rt-vars.mk" | ||||
Show All 9 Lines |