From owner-freebsd-current@FreeBSD.ORG Thu Oct 25 11:58:39 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B36E0B01 for ; Thu, 25 Oct 2012 11:58:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6AF708FC0C for ; Thu, 25 Oct 2012 11:58:39 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:ed82:888c:f11e:aaaf] (unknown [IPv6:2001:7b8:3a7:0:ed82:888c:f11e:aaaf]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id F08435C59; Thu, 25 Oct 2012 13:58:37 +0200 (CEST) Message-ID: <5089296F.1030001@FreeBSD.org> Date: Thu, 25 Oct 2012 13:58:39 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Piotr Kubaj Subject: Re: Compilling CURRENT with libc++ References: <50892562.6040202@gmail.com> In-Reply-To: <50892562.6040202@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 11:58:39 -0000 On 2012-10-25 13:41, Piotr Kubaj wrote: > Is it actually possible? I've used clang before for compiling world, but > when I try to use libc++, it fails with several errors. It's a quite > recent revision, with the newest libc++ MFV. Currently, it is rather tricky, since we do not have a proper way of bootstrapping it yet. For now, you would have to do the following: - Enable WITH_LIBCPLUSPLUS in src.conf - cd /usr/src/lib/libcxxrt && make obj && make depend && make && sudo make install - cd /usr/src/lib/libc++ && make obj && make depend && make && sudo make install - Now you should have the libc++ headers and libraries installed in base. (Check /usr/include/c++/v1/* and /usr/lib/libc++*.) - In make.conf or src.conf, add: CXXFLAGS+= -stdlib=libc++ -std=c++11 or use another -std= setting, except -std=gnu++98 or std=c++98. Might as well turn it to eleven, anyway. :-) - Build world, kernel and install both in the regular way. - Now you should have a world where all C++ programs in base are linked against libc++ and libcxxrt. Please note: while I have used this for at least a few months, and I have encountered no (crippling) problems yet, there will most likely be bugs, so take care! For example, Jan Beich reported recently that devd seems to have trouble with some regular expressions in devd.conf, if it is linked to libc++. It it still unknown what causes this.