2014-11-03 19:56:25 -05:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
2016-06-28 03:47:42 -04:00
|
|
|
# XXX This is a workaround to allow i386 to cross-compile on an amd64 host.
|
|
|
|
|
.include <host-target.mk>
|
|
|
|
|
# XXX ---
|
|
|
|
|
|
2014-11-03 19:56:25 -05:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
|
|
|
|
|
NO_WERROR=
|
|
|
|
|
WARNS?= 2
|
|
|
|
|
|
|
|
|
|
CFLAGS.h_raw+= -fstack-protector-all -Wstack-protector
|
|
|
|
|
.if ${COMPILER_TYPE} == "clang"
|
|
|
|
|
CFLAGS.h_raw+= -fsanitize=bounds
|
|
|
|
|
.elif ${COMPILER_TYPE} == "gcc"
|
|
|
|
|
CFLAGS.h_raw+= --param ssp-buffer-size=1
|
2015-12-05 13:56:21 -05:00
|
|
|
LDADD+= -lssp
|
2014-11-03 19:56:25 -05:00
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
NETBSD_ATF_TESTS_SH= ssp_test
|
|
|
|
|
|
|
|
|
|
BINDIR= ${TESTSDIR}
|
|
|
|
|
|
|
|
|
|
PROGS= h_fgets
|
|
|
|
|
PROGS+= h_gets
|
|
|
|
|
PROGS+= h_getcwd
|
|
|
|
|
PROGS+= h_memcpy
|
|
|
|
|
PROGS+= h_memmove
|
|
|
|
|
PROGS+= h_memset
|
2015-01-02 00:40:02 -05:00
|
|
|
# This testcase doesn't run properly when not compiled with -fsantize=bounds
|
|
|
|
|
# with clang, which is currently contingent on a compiler_rt update
|
2015-10-30 04:06:24 -04:00
|
|
|
#
|
|
|
|
|
# XXX: the h_raw/h_read testcases don't cause a SIGABRT with in-tree gcc right
|
|
|
|
|
# now on amd64 when it trips the stack bounds specified in t_ssp.sh . This
|
|
|
|
|
# probably needs to be fixed as it's currently hardcoded.
|
2015-10-30 13:05:52 -04:00
|
|
|
#
|
|
|
|
|
# sanitizer is not tested or supported for ARM right now. sbruno
|
|
|
|
|
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
|
2016-03-31 13:27:17 -04:00
|
|
|
.if ${COMPILER_TYPE} == "clang" && ${MK_TOOLCHAIN} == "yes"
|
2015-10-30 04:06:24 -04:00
|
|
|
.if ${COMPILER_VERSION} < 30500 || 30700 <= ${COMPILER_VERSION}
|
2016-06-28 03:47:42 -04:00
|
|
|
|
|
|
|
|
# XXX This is a workaround to allow i386 to cross-compile on an amd64 host.
|
|
|
|
|
.if ${MACHINE_CPUARCH} == ${_HOST_ARCH}
|
|
|
|
|
# XXX ---
|
|
|
|
|
|
2014-11-03 19:56:25 -05:00
|
|
|
PROGS+= h_raw
|
2016-06-28 03:47:42 -04:00
|
|
|
|
|
|
|
|
# XXX This is a workaround to allow i386 to cross-compile on an amd64 host.
|
|
|
|
|
.endif
|
|
|
|
|
# XXX ---
|
|
|
|
|
|
2015-01-02 00:40:02 -05:00
|
|
|
.endif
|
2015-10-30 04:06:24 -04:00
|
|
|
.endif
|
2015-10-30 13:05:52 -04:00
|
|
|
.endif
|
2014-11-03 19:56:25 -05:00
|
|
|
PROGS+= h_read
|
|
|
|
|
PROGS+= h_readlink
|
|
|
|
|
PROGS+= h_snprintf
|
|
|
|
|
PROGS+= h_sprintf
|
|
|
|
|
PROGS+= h_stpcpy
|
|
|
|
|
PROGS+= h_stpncpy
|
|
|
|
|
PROGS+= h_strcat
|
|
|
|
|
PROGS+= h_strcpy
|
|
|
|
|
PROGS+= h_strncat
|
|
|
|
|
PROGS+= h_strncpy
|
|
|
|
|
PROGS+= h_vsnprintf
|
|
|
|
|
PROGS+= h_vsprintf
|
|
|
|
|
|
|
|
|
|
.include "../Makefile.netbsd-tests"
|
|
|
|
|
|
|
|
|
|
.include <bsd.test.mk>
|