Home | History | Annotate | Line # | Download | only in libasan
      1 # $NetBSD: Makefile,v 1.39 2025/10/20 14:31:37 nat Exp $
      2 
      3 UNSUPPORTED_COMPILER.clang=	# defined
      4 NOSANITIZER=	# defined
      5 
      6 .include <bsd.own.mk>
      7 
      8 .include "../Makefile.inc"
      9 .include "../Makefile.sanitizer"
     10 
     11 .PATH: ${SANITIZER}/asan ${SANITIZER}/lsan
     12 
     13 # XXXmknative
     14 ASAN_SRCS= \
     15 	asan_activation.cpp \
     16 	asan_allocator.cpp \
     17 	asan_debugging.cpp \
     18 	asan_descriptions.cpp \
     19 	asan_errors.cpp \
     20 	asan_fake_stack.cpp \
     21 	asan_flags.cpp \
     22 	asan_globals.cpp \
     23 	asan_interceptors.cpp \
     24 	asan_interceptors_memintrinsics.cpp \
     25 	asan_linux.cpp \
     26 	asan_mac.cpp \
     27 	asan_malloc_linux.cpp \
     28 	asan_malloc_mac.cpp \
     29 	asan_malloc_win.cpp \
     30 	asan_memory_profile.cpp \
     31 	asan_new_delete.cpp \
     32 	asan_poisoning.cpp \
     33 	asan_posix.cpp \
     34 	asan_premap_shadow.cpp \
     35 	asan_report.cpp \
     36 	asan_rtl.cpp \
     37 	asan_shadow_setup.cpp \
     38 	asan_stack.cpp \
     39 	asan_stats.cpp \
     40 	asan_suppressions.cpp \
     41 	asan_thread.cpp \
     42 	asan_win.cpp \
     43 	asan_win_dll_thunk.cpp \
     44 	asan_win_dynamic_runtime_thunk.cpp \
     45 	asan_interceptors_vfork.S
     46 
     47 LIB=	asan
     48 SRCS+=	${ASAN_SRCS} lsan_common.cpp lsan_common_linux.cpp
     49 LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt
     50 LIBDPLIBS+= m  ${NETBSDSRCDIR}/lib/libm
     51 LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
     52 CPPFLAGS+=-DCAN_SANITIZE_UB=0
     53 
     54 .if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
     55 COPTS.asan_interceptors.cpp += -O1
     56 .endif
     57 
     58 # This helps, but isn't enough.
     59 .if ${MACHINE_ARCH:S/m68ksf/m68k/} == "m68k" || ${MACHINE_ARCH} == "m68000"
     60 COPTS.asan_interceptors.cpp += -fno-jump-tables -Os
     61 COPTS.asan_interceptors.cpp += -mlong-jump-table-offsets -Os
     62 .endif
     63 
     64 .include "../preinit.mk"
     65 
     66 .include <bsd.lib.mk>
     67