1 1.3.2.2 christos # $NetBSD: Makefile,v 1.3.2.2 2019/06/10 22:10:04 christos Exp $ 2 1.3.2.2 christos 3 1.3.2.2 christos .include <bsd.own.mk> 4 1.3.2.2 christos 5 1.3.2.2 christos TESTSDIR= ${TESTSBASE}/lib/libc/misc 6 1.3.2.2 christos 7 1.3.2.2 christos TESTS_C+= t_ubsan 8 1.3.2.2 christos TESTS_CXX+= t_ubsanxx 9 1.3.2.2 christos 10 1.3.2.2 christos .PATH: ${NETBSDSRCDIR}/common/lib/libc/misc 11 1.3.2.2 christos SRCS.t_ubsan= t_ubsan.c ubsan.c 12 1.3.2.2 christos SRCS.t_ubsanxx= t_ubsanxx.cpp ubsan.c 13 1.3.2.2 christos 14 1.3.2.2 christos .if ${MKSANITIZER:Uno} != "yes" && ${MKLIBCSANITIZER:Uno} != "yes" 15 1.3.2.2 christos # These tests are designed to be used against micro-UBSan only. 16 1.3.2.2 christos # micro-UBSan is used in these tests as a standalone libary only. 17 1.3.2.2 christos CPPFLAGS+= -DENABLE_TESTS 18 1.3.2.2 christos UBSAN_FLAGS= -fsanitize=undefined 19 1.3.2.2 christos UBSAN_FLAGS+= ${${ACTIVE_CC} == "clang" :? -fsanitize=integer :} 20 1.3.2.2 christos UBSAN_FLAGS+= ${${ACTIVE_CC} == "clang" :? -fsanitize=nullability :} 21 1.3.2.2 christos CFLAGS+= ${UBSAN_FLAGS} 22 1.3.2.2 christos CXXFLAGS+= ${UBSAN_FLAGS} 23 1.3.2.2 christos CWARNFLAGS+= -Wno-return-type -Wno-strict-aliasing 24 1.3.2.2 christos CWARNFLAGS.clang+= -Wno-incompatible-pointer-types-discards-qualifiers 25 1.3.2.2 christos CWARNFLAGS.clang+= -Wno-nullability-completeness 26 1.3.2.2 christos .endif 27 1.3.2.2 christos COPTS.t_ubsan.c += -Wno-stack-protector 28 1.3.2.2 christos COPTS.t_ubsanxx.cpp += -Wno-stack-protector 29 1.3.2.2 christos 30 1.3.2.2 christos .if defined(HAVE_GCC) && ${HAVE_GCC} == 7 && ${ACTIVE_CC} == "gcc" 31 1.3.2.2 christos COPTS.t_ubsan.c+= -Wno-int-in-bool-context 32 1.3.2.2 christos COPTS.t_ubsanxx.cpp+= -Wno-int-in-bool-context 33 1.3.2.2 christos .endif 34 1.3.2.2 christos 35 1.3.2.2 christos .include <bsd.test.mk> 36