summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2020-10-26 17:50:34 +0000
committerBrooks Davis <brooks@FreeBSD.org>2020-10-26 17:50:34 +0000
commit1468f36d44e739dff9cc6044fab527cbc0b806c6 (patch)
treeda405b5f79df1465029d46cf96101f5393486dd3
parent1dc26e0871205bb6a43f32c9139ee149d99a5035 (diff)
downloadsrc-test2-1468f36d44e739dff9cc6044fab527cbc0b806c6.tar.gz
src-test2-1468f36d44e739dff9cc6044fab527cbc0b806c6.zip
MFC r366981:
Only use ASAN when using the in-tree compiler When building FreeBSD 11 on a FreeBSD 12 system with CROSS_TOOLCHAIN=llvm10 we end up trying to link against the packaged version of the sanitizer library. This resulted in a requirement for getentropy(3) which is not present in FreeBSD 11. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D26903
Notes
Notes: svn path=/stable/11/; revision=367062
-rw-r--r--lib/libc/tests/ssp/Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/tests/ssp/Makefile b/lib/libc/tests/ssp/Makefile
index 54dceb0eceb7..f321fe08f2a0 100644
--- a/lib/libc/tests/ssp/Makefile
+++ b/lib/libc/tests/ssp/Makefile
@@ -6,7 +6,9 @@ NO_WERROR=
WARNS?= 2
CFLAGS.h_raw+= -fstack-protector-all -Wstack-protector
-.if ${COMPILER_TYPE} == "clang"
+.if ${COMPILER_TYPE} == "clang" && ${CC} == "cc"
+# Only use -fsanitize=bounds when using the in-tree compiler. Otherwise
+# we may link to a sanitizer library targeted at a newer kernel/libc.
CFLAGS.h_raw+= -fsanitize=bounds
.elif ${COMPILER_TYPE} == "gcc"
CFLAGS.h_raw+= --param ssp-buffer-size=1