1 2 .include <bsd.own.mk> 3 4 .include "../Makefile.inc" 5 6 ASAN=${GCCDIST}/libsanitizer 7 .PATH: ${ASAN}/asan ${ASAN}/interception ${ASAN}/sanitizer_common 8 9 ASAN_SRCS= \ 10 asan_allocator2.cc \ 11 asan_interceptors.cc \ 12 asan_posix.cc \ 13 asan_new_delete.cc \ 14 asan_rtl.cc \ 15 asan_stats.cc \ 16 asan_globals.cc \ 17 asan_fake_stack.cc \ 18 asan_linux.cc \ 19 asan_report.cc \ 20 asan_malloc_linux.cc \ 21 asan_poisoning.cc \ 22 asan_stack.cc \ 23 asan_thread.cc \ 24 asan_preinit.cc 25 26 INTERCEPTION_SRCS= \ 27 interception_linux.cc \ 28 interception_type_test.cc 29 30 SANITIZER_SRCS= \ 31 sanitizer_allocator.cc \ 32 sanitizer_common.cc \ 33 sanitizer_flags.cc \ 34 sanitizer_libc.cc \ 35 sanitizer_netbsd.cc \ 36 sanitizer_mac.cc \ 37 sanitizer_posix.cc \ 38 sanitizer_platform_limits_posix.cc \ 39 sanitizer_printf.cc \ 40 sanitizer_stackdepot.cc \ 41 sanitizer_stacktrace.cc \ 42 sanitizer_symbolizer.cc \ 43 sanitizer_win.cc 44 45 # The linux build does this to avoid preinit sections on shared libraries 46 CSHLIBFLAGS+= -DPIC 47 48 LIB= asan 49 SRCS= ${ASAN_SRCS} ${INTERCEPTION_SRCS} ${SANITIZER_SRCS} 50 CPPFLAGS+=-I${ASAN}/include -I${ASAN} 51 CPPFLAGS.sanitizer_netbsd.cc+=-I${GCCDIST}/gcc/ginclude 52 53 LIBDPLIBS+= stdc++ ${.CURDIR}/../libstdc++-v3 54 LIBDPLIBS+= pthread ${.CURDIR}/../../../../../lib/libpthread 55 56 .if ${MACHINE_ARCH} == "vax" 57 COPTS.asan_allocator2.cc += -O1 58 COPTS.sanitizer_mac.cc += -O1 59 COPTS.sanitizer_netbsd.cc += -O1 60 COPTS.sanitizer_printf.cc += -O1 61 COPTS.sanitizer_stackdepot.cc += -O1 62 .endif 63 64 .include <bsd.lib.mk> 65