From owner-freebsd-toolchain@FreeBSD.ORG Mon Jan 12 20:37:42 2015 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD48F986 for ; Mon, 12 Jan 2015 20:37:42 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [IPv6:2001:4f8:3:ffe0:406a:0:50:2]) (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 AE958A05 for ; Mon, 12 Jan 2015 20:37:42 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [127.0.1.5]) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9) with ESMTP id t0CKbgWM012752 for ; Mon, 12 Jan 2015 20:37:42 GMT (envelope-from root@phabric-backend.isc.freebsd.org) Received: (from root@localhost) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9/Submit) id t0CKbgA9012750; Mon, 12 Jan 2015 20:37:42 GMT (envelope-from root) Date: Mon, 12 Jan 2015 20:37:42 +0000 To: freebsd-toolchain@freebsd.org From: "dim (Dimitry Andric)" Subject: [Differential] [Request, 52 lines] D1505: Enable building libclang_rt (asan, ubsan and profile) for selected arches Message-ID: X-Priority: 3 Thread-Topic: D1505: Enable building libclang_rt (asan, ubsan and profile) for selected arches X-Herald-Rules: none X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Thread-Index: YjlmOWUwYWQyZjg0MzJiMzU4YjhhNDM2ZmVh X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , , , MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2015 20:37:43 -0000 dim created this revision. dim added reviewers: andrew, bapt, emaste, imp. dim added a subscriber: freebsd-toolchain. REVISION SUMMARY I added the libclang_rt libraries (Address Sanitizer, Undefined Behavior Sanitizer and Profile Guided Optimization) from compiler-rt to the tree recently, but did not connect them to the build yet. The requirements for these libraries are: * Must be built with clang, gcc (not even recent versions) can build them * Only make sense to build when either the cross-tools stage (e.g. the stuff installed under ${WORLDTMP}) has clang enabled, or when then final world has clang enabled. * The sanitizer libraries can only be built for i386 and amd64. * The profile library can only be built for i386, amd64 and LE arm. Apart from the bit of ugliness in lib/Makefile (which Warner does not like), there is also still a practical problem, which I have not been able to solve as of yet: On amd64, the build32 stage will now build the libclang_rt libraries, but due to ${LIB32IMAKE} containing MK_TOOLCHAIN=no, the install32 stage will *not* install them. I don't see any easy way around this, excect maybe partially reverting r264930, but that will get us back to the situation with NO_INCS, which Warner tried to avoid with that commit. Note that I also did not introduce yet another WITH_LIBCLANG_RT knob, since I don't really see the need: WITH_CLANG should basically always cause these libraries to be built and installed. However, if the general opinion is that another knob is good to have, I can implement it, and move the lib/Makefile ugliness to src.opts.mk instead. TEST PLAN Build and install in various situations. Do a bunch of runtime tests to ascertain the asan, ubsan and profile libraries can be found when building programs with -fsanitize=address, -fsanitize=undefined and -fprofile-generate, respectively. BRANCH /head REVISION DETAIL https://reviews.freebsd.org/D1505 AFFECTED FILES etc/mtree/BSD.usr.dist lib/Makefile lib/libclang_rt/Makefile tools/build/mk/OptionalObsoleteFiles.inc To: dim, andrew, bapt, emaste, imp Cc: freebsd-toolchain