svn commit: r366981 - head/lib/libc/tests/ssp

Brooks Davis brooks at FreeBSD.org
Fri Oct 23 22:27:46 UTC 2020


Author: brooks
Date: Fri Oct 23 22:27:45 2020
New Revision: 366981
URL: https://svnweb.freebsd.org/changeset/base/366981

Log:
  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
  MFC after:	3 days
  Differential Revision:	https://reviews.freebsd.org/D26903

Modified:
  head/lib/libc/tests/ssp/Makefile

Modified: head/lib/libc/tests/ssp/Makefile
==============================================================================
--- head/lib/libc/tests/ssp/Makefile	Fri Oct 23 21:27:48 2020	(r366980)
+++ head/lib/libc/tests/ssp/Makefile	Fri Oct 23 22:27:45 2020	(r366981)
@@ -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


More information about the svn-src-head mailing list