From owner-svn-src-head@FreeBSD.ORG Tue Jan 13 19:54:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DBD8FC6; Tue, 13 Jan 2015 19:54:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E488261; Tue, 13 Jan 2015 19:54:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0DJsntr090238; Tue, 13 Jan 2015 19:54:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0DJslhB090231; Tue, 13 Jan 2015 19:54:47 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201501131954.t0DJslhB090231@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 13 Jan 2015 19:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277146 - in head: etc/mtree lib lib/libclang_rt tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2015 19:54:49 -0000 Author: dim Date: Tue Jan 13 19:54:47 2015 New Revision: 277146 URL: https://svnweb.freebsd.org/changeset/base/277146 Log: 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 Modified: head/etc/mtree/BSD.debug.dist head/etc/mtree/BSD.usr.dist head/lib/Makefile head/lib/libclang_rt/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/etc/mtree/BSD.debug.dist ============================================================================== --- head/etc/mtree/BSD.debug.dist Tue Jan 13 19:38:43 2015 (r277145) +++ head/etc/mtree/BSD.debug.dist Tue Jan 13 19:54:47 2015 (r277146) @@ -24,6 +24,14 @@ games .. lib + clang + 3.5.0 + lib + freebsd + .. + .. + .. + .. engines .. i18n Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Tue Jan 13 19:38:43 2015 (r277145) +++ head/etc/mtree/BSD.usr.dist Tue Jan 13 19:54:47 2015 (r277146) @@ -14,6 +14,14 @@ lib aout .. + clang + 3.5.0 + lib + freebsd + .. + .. + .. + .. compat aout .. Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Tue Jan 13 19:38:43 2015 (r277145) +++ head/lib/Makefile Tue Jan 13 19:54:47 2015 (r277146) @@ -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++ Modified: head/lib/libclang_rt/Makefile ============================================================================== --- head/lib/libclang_rt/Makefile Tue Jan 13 19:38:43 2015 (r277145) +++ head/lib/libclang_rt/Makefile Tue Jan 13 19:54:47 2015 (r277146) @@ -1,10 +1,18 @@ # $FreeBSD$ -SUBDIR= asan\ - asan_cxx\ - profile\ - san\ - ubsan\ - ubsan_cxx +.include + +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +SUBDIR+= asan\ + asan_cxx\ + san\ + ubsan\ + ubsan_cxx +.endif + +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || \ + (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb") +SUBDIR+= profile +.endif .include Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Jan 13 19:38:43 2015 (r277145) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Jan 13 19:54:47 2015 (r277146) @@ -527,6 +527,23 @@ OLD_FILES+=usr/include/clang/3.5.0/xmmin OLD_FILES+=usr/include/clang/3.5.0/xopintrin.h OLD_DIRS+=usr/include/clang/3.5.0 OLD_DIRS+=usr/include/clang +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.san-i386.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.san-x86_64.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.ubsan-i386.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.ubsan-x86_64.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.ubsan_cxx-i386.a +OLD_FILES+=usr/lib/clang/3.5.0/lib/freebsd/libclang_rt.ubsan_cxx-x86_64.a +OLD_DIRS+=usr/lib/clang/3.5.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/3.5.0/lib +OLD_DIRS+=usr/lib/clang/3.5.0 +OLD_DIRS+=usr/lib/clang OLD_FILES+=usr/share/doc/llvm/clang/LICENSE.TXT OLD_DIRS+=usr/share/doc/llvm/clang OLD_FILES+=usr/share/doc/llvm/COPYRIGHT.regex