1 # $NetBSD: Makefile,v 1.9 2025/09/07 04:12:28 mrg Exp $ 2 3 UNSUPPORTED_COMPILER.clang= # defined 4 LIBISCXX = yes 5 6 .include <bsd.own.mk> 7 8 .include "../Makefile.inc" 9 .include "../Makefile.sanitizer" 10 11 .PATH: ${SANITIZER}/ubsan 12 13 # XXXmknative 14 UBSAN_SRCS= \ 15 ubsan_diag.cpp \ 16 ubsan_flags.cpp \ 17 ubsan_handlers.cpp \ 18 ubsan_handlers_cxx.cpp \ 19 ubsan_init.cpp \ 20 ubsan_monitor.cpp \ 21 ubsan_type_hash.cpp \ 22 ubsan_type_hash_itanium.cpp \ 23 ubsan_type_hash_win.cpp \ 24 ubsan_value.cpp 25 26 .for _s in ubsan_handlers_cxx ubsan_type_hash ubsan_type_hash_itanium 27 COPTS.${_s}.cpp+=-frtti 28 .endfor 29 30 .if ${MACHINE_ARCH} == "vax" 31 COPTS.sanitizer_file.cpp += -O1 32 .endif 33 34 LIB= ubsan 35 SRCS+= ${UBSAN_SRCS} 36 LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm 37 LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt 38 LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread 39 CPPFLAGS+=-DCAN_SANITIZE_UB=1 -DUBSAN_CAN_USE_CXXABI=1 40 41 # XXX 42 COPTS.ubsan_handlers.cpp+=${CC_WNO_MAYBE_UNINITIALIZED} 43 44 .include <bsd.lib.mk> 45