]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/tests/ssp/Makefile
MFV r315875:
[FreeBSD/FreeBSD.git] / lib / libc / tests / ssp / Makefile
1 # $FreeBSD$
2
3 # XXX This is a workaround to allow i386 to cross-compile on an amd64 host.
4 .include <host-target.mk>
5 # XXX ---
6
7 .include <bsd.own.mk>
8
9 NO_WERROR=
10 WARNS?= 2
11
12 CFLAGS.h_raw+=  -fstack-protector-all -Wstack-protector
13 .if ${COMPILER_TYPE} == "clang"
14 CFLAGS.h_raw+=  -fsanitize=bounds
15 .elif ${COMPILER_TYPE} == "gcc"
16 CFLAGS.h_raw+=  --param ssp-buffer-size=1
17 LDADD+= -lssp
18 .endif
19
20 NETBSD_ATF_TESTS_SH=    ssp_test
21
22 BINDIR=         ${TESTSDIR}
23
24 PROGS=          h_fgets
25 PROGS+=         h_gets
26 PROGS+=         h_getcwd
27 PROGS+=         h_memcpy
28 PROGS+=         h_memmove
29 PROGS+=         h_memset
30 # This testcase doesn't run properly when not compiled with -fsantize=bounds
31 # with clang, which is currently contingent on a compiler_rt update
32 #
33 # XXX: the h_raw/h_read testcases don't cause a SIGABRT with in-tree gcc right
34 # now on amd64 when it trips the stack bounds specified in t_ssp.sh . This
35 # probably needs to be fixed as it's currently hardcoded.
36 #
37 # sanitizer is not tested or supported for ARM right now. sbruno
38 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
39 .if ${COMPILER_TYPE} == "clang" && ${MK_TOOLCHAIN} == "yes"
40 .if ${COMPILER_VERSION} < 30500 || 30700 <= ${COMPILER_VERSION}
41
42 # XXX This is a workaround to allow i386 to cross-compile on an amd64 host.
43 .if ${MACHINE_CPUARCH} == ${_HOST_ARCH}
44 # XXX ---
45
46 PROGS+=         h_raw
47
48 # XXX This is a workaround to allow i386 to cross-compile on an amd64 host.
49 .endif
50 # XXX ---
51
52 .endif
53 .endif
54 .endif
55 PROGS+=         h_read
56 PROGS+=         h_readlink
57 PROGS+=         h_snprintf
58 PROGS+=         h_sprintf
59 PROGS+=         h_stpcpy
60 PROGS+=         h_stpncpy
61 PROGS+=         h_strcat
62 PROGS+=         h_strcpy
63 PROGS+=         h_strncat
64 PROGS+=         h_strncpy
65 PROGS+=         h_vsnprintf
66 PROGS+=         h_vsprintf
67
68 .include "../Makefile.netbsd-tests"
69
70 .include <bsd.test.mk>