1 2.include <bsd.own.mk> 3 4MK_WERROR= no 5WARNS?= 2 6 7CFLAGS.h_raw+= -fstack-protector-all -Wstack-protector 8.if ${COMPILER_TYPE} == "clang" 9# Only use -fsanitize=bounds when using clang. Otherwise we are not able to 10# override the sanitizer runtime libraries to be the ones installed on the 11# target system. 12CFLAGS.h_raw+= -fsanitize=bounds 13LIBADD+=sys 14.elif ${COMPILER_TYPE} == "gcc" 15CFLAGS.h_raw+= --param ssp-buffer-size=1 16LDADD+= -lssp 17.endif 18 19NETBSD_ATF_TESTS_SH= ssp_test 20 21BINDIR= ${TESTSDIR} 22 23PROGS= h_fgets 24PROGS+= h_gets 25PROGS+= h_getcwd 26PROGS+= h_memcpy 27PROGS+= h_memmove 28PROGS+= h_memset 29# XXX: the h_raw/h_read testcases don't cause a SIGABRT with in-tree gcc right 30# now on amd64 when it trips the stack bounds specified in t_ssp.sh . This 31# probably needs to be fixed as it's currently hardcoded. 32.if ${COMPILER_TYPE} == "clang" && !defined(_SKIP_BUILD) && \ 33 (!defined(_RECURSING_PROGS) || ${PROG} == "h_raw") && \ 34 defined(MK_CLANG) && ${MK_CLANG} == "yes" 35.include "${SRCTOP}/lib/libclang_rt/compiler-rt-vars.mk" 36_libclang_rt_ubsan= ${SYSROOT}${SANITIZER_LIBDIR}/libclang_rt.ubsan_standalone-${CRTARCH}.a 37.if exists(${_libclang_rt_ubsan}) 38PROGS+= h_raw 39LDADD.h_raw+= ${SANITIZER_LDFLAGS} 40.else 41.if make(all) 42.info Could not find runtime library ${_libclang_rt_ubsan}, skipping h_raw 43.endif 44.endif 45.endif 46PROGS+= h_read 47PROGS+= h_readlink 48PROGS+= h_snprintf 49PROGS+= h_sprintf 50PROGS+= h_stpcpy 51PROGS+= h_stpncpy 52PROGS+= h_strcat 53PROGS+= h_strcpy 54PROGS+= h_strncat 55PROGS+= h_strncpy 56PROGS+= h_vsnprintf 57PROGS+= h_vsprintf 58 59.include "../Makefile.netbsd-tests" 60 61.include <bsd.test.mk> 62