1 # $NetBSD: Makefile,v 1.13 2025/09/07 04:12:28 mrg Exp $ 2 3 UNSUPPORTED_COMPILER.clang= # defined 4 NOSANITIZER= # defined 5 NOCOMPAT= # defined 6 7 .include <bsd.own.mk> 8 9 .include "../Makefile.inc" 10 .include "../Makefile.sanitizer" 11 12 .PATH: ${SANITIZER}/tsan 13 14 # XXXmknative 15 TSAN_SRCS= \ 16 tsan_clock.cpp \ 17 tsan_debugging.cpp \ 18 tsan_external.cpp \ 19 tsan_fd.cpp \ 20 tsan_flags.cpp \ 21 tsan_ignoreset.cpp \ 22 tsan_interceptors_posix.cpp \ 23 tsan_interceptors_mac.cpp \ 24 tsan_interface_ann.cpp \ 25 tsan_interface_atomic.cpp \ 26 tsan_interface.cpp \ 27 tsan_interface_java.cpp \ 28 tsan_malloc_mac.cpp \ 29 tsan_md5.cpp \ 30 tsan_mman.cpp \ 31 tsan_mutexset.cpp \ 32 tsan_new_delete.cpp \ 33 tsan_platform_linux.cpp \ 34 tsan_platform_mac.cpp \ 35 tsan_platform_posix.cpp \ 36 tsan_platform_windows.cpp \ 37 tsan_report.cpp \ 38 tsan_rtl.cpp \ 39 tsan_rtl_access.cpp \ 40 tsan_rtl_mutex.cpp \ 41 tsan_rtl_proc.cpp \ 42 tsan_rtl_report.cpp \ 43 tsan_rtl_thread.cpp \ 44 tsan_stack_trace.cpp \ 45 tsan_suppressions.cpp \ 46 tsan_symbolize.cpp \ 47 tsan_sync.cpp \ 48 tsan_vector_clock.cpp 49 50 .if ${MACHINE_ARCH} == "x86_64" 51 TSAN_SRCS+= tsan_rtl_amd64.S 52 .elif ${MACHINE_CPU} == "aarch64" 53 TSAN_SRCS+= tsan_rtl_aarch64.S 54 .elif ${MACHINE_MIPS64} 55 TSAN_SRCS+= tsan_rtl_mips64.S 56 .elif ${MACHINE_ARCH} == "powerpc64" 57 TSAN_SRCS+= tsan_rtl_ppc64.S 58 .else 59 .error Unsupported 60 .endif 61 62 LIB= tsan 63 SRCS+= ${TSAN_SRCS} 64 LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt 65 LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm 66 LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread 67 CPPFLAGS+=-DCAN_SANITIZE_UB=0 68 COPTS.tsan_interceptors.cpp += -Wno-unused-function 69 70 .include "../preinit.mk" 71 72 .include <bsd.lib.mk> 73