summaryrefslogtreecommitdiffstats
path: root/lib/Makefile
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-01-13 19:54:47 +0000
committerdim <dim@FreeBSD.org>2015-01-13 19:54:47 +0000
commitd07708df700d3cefccf39ee729e8b88653cd6fc8 (patch)
tree8f0287406f357e41799e220f84b1cb8e6be46439 /lib/Makefile
parentea004da6c19049bd1b52fe5ead36e0d3d07ea1de (diff)
downloadFreeBSD-src-d07708df700d3cefccf39ee729e8b88653cd6fc8.zip
FreeBSD-src-d07708df700d3cefccf39ee729e8b88653cd6fc8.tar.gz
Connect libclang_rt to the build, for specific architectures. This
contains the libraries for Address Sanitizer (asan), Undefined Behavior Sanitizer (ubsan) and Profile Guided Optimization. ASan is a fast memory error detector. It can detect the following types of bugs: Out-of-bounds accesses to heap, stack and globals Use-after-free Use-after-return (to some extent) Double-free, invalid free Memory leaks (experimental) Typical slowdown introduced by AddressSanitizer is 2x. UBSan is a fast and compatible undefined behavior checker. It enables a number of undefined behavior checks that have small runtime cost and no impact on address space layout or ABI. PLEASE NOTE: the sanitizers still have some rough edges on FreeBSD, particularly on i386. These will hopefully be smoothed out in the coming time. Differential Revision: https://reviews.freebsd.org/D1505
Diffstat (limited to 'lib/Makefile')
-rw-r--r--lib/Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Makefile b/lib/Makefile
index 4d30c53..c51ae96 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -13,6 +13,7 @@ SUBDIR_ORDERED= ${_csu} \
libc \
libc_nonshared \
libcompiler_rt \
+ ${_libclang_rt} \
${_libcplusplus} \
${_libcxxrt} \
libelf \
@@ -211,6 +212,15 @@ _libcom_err= libcom_err
_libldns= libldns
.endif
+# The libraries under libclang_rt can only be built by clang, and only make
+# sense to build when clang is enabled at all. Furthermore, they can only be
+# built for certain architectures.
+.if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \
+ (${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || \
+ (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb"))
+_libclang_rt= libclang_rt
+.endif
+
.if ${MK_LIBCPLUSPLUS} != "no"
_libcxxrt= libcxxrt
_libcplusplus= libc++
OpenPOWER on IntegriCloud