From owner-freebsd-toolchain@FreeBSD.ORG Mon Sep 17 19:37:00 2012 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D541C106566B for ; Mon, 17 Sep 2012 19:37:00 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id 94E1A8FC12 for ; Mon, 17 Sep 2012 19:37:00 +0000 (UTC) Received: by iea17 with SMTP id 17so7602164iea.13 for ; Mon, 17 Sep 2012 12:37:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=FLZ6Bkk+KW9qzI/uPUTDhtrAYpePrTqMkBH6brvswCY=; b=a1v2Fkg5AoITo7RQa6FkQOUDwSjWiZYJa2AVYlX6KKZAp/hWs43p9ac63pZyrJmnvE 9Kh/Ss2riT3wr2zRKEoVr0ktb6TDavVtGpy/Pj9FFizhW9Cvfgn7W0uiwH+uIHMvoBGF 2hOyVAUJIwh0UgGhLLt9POcyddkW7EC+hJlih0j55+VWOIaajn1ggP+NnWdTmLLZmUfm RzznS80/kWdbgI5juLvdAJTi7ZhKSz5u28J+YcAZ7JEE5fBaOpmz2/vEKM956ye5vDEd aDNwqTiU1J46ocfnpKDXD8rOAJQDNFvpfUGOr8CdI1Nuh2lDkd+wWi8NdJW548B/Fjsd /jzQ== Received: by 10.43.7.132 with SMTP id oo4mr9897766icb.6.1347910619967; Mon, 17 Sep 2012 12:36:59 -0700 (PDT) Received: from 63.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id a10sm19261625igd.1.2012.09.17.12.36.54 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 12:36:57 -0700 (PDT) Sender: Warner Losh Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20120917191028.GA42648@lor.one-eyed-alien.net> Date: Mon, 17 Sep 2012 13:36:53 -0600 Content-Transfer-Encoding: 7bit Message-Id: <0D8164DE-97A3-4870-A8DF-37E91ECFE87F@bsdimp.com> References: <20120917191028.GA42648@lor.one-eyed-alien.net> To: Brooks Davis X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQmmLU4QTUlDTuKKKEZoIAJW+zODsjEI4HReewlnTuIz2grGLb7BiCgtSVwvIHAeaTM5mDQ2 Cc: toolchain@freebsd.org Subject: Re: enabling libc++ by default when building with clang X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 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, 17 Sep 2012 19:37:00 -0000 On Sep 17, 2012, at 1:10 PM, Brooks Davis wrote: > Now that we have the COMPILER_TYPE variable I'm following up on an idea > by theraven@ that we should enable libc++ by default when we are > building world with a compiler that supports it. The following patch > implements this: > > http://people.freebsd.org/~brooks/patches/libc%2b%2b-default.diff > > One key question is, when do we want to throw this switch? Do we do it > now so people using clang start using it sooner or do we wait until > we've switched the default compiler and things have settled a bit? > > I suspect that we'll want to wait, but I'm curious what others think. Is the compiler type set to be the host's build, or the target's? Warner > -- Brooks > > Index: share/mk/bsd.own.mk > =================================================================== > --- share/mk/bsd.own.mk (revision 240466) > +++ share/mk/bsd.own.mk (working copy) > @@ -432,7 +432,6 @@ > ICONV \ > IDEA \ > INSTALL_AS_USER \ > - LIBCPLUSPLUS \ > NAND \ > OFED \ > SHARED_TOOLCHAIN > @@ -642,6 +641,33 @@ > .endif > .endfor > > +# > +# MK_* options that default to on if the compiler is clang. > +# > +.include > +.for var in \ > + LIBCPLUSPLUS > +.if defined(WITH_${var}) && defined(WITHOUT_${var}) > +.error WITH_${var} and WITHOUT_${var} can't both be set. > +.endif > +.if defined(MK_${var}) > +.error MK_${var} can't be set by a user. > +.endif > +.if ${COMPILER_TYPE} == "clang" > +.if defined(WITHOUT_${var}) > +MK_${var}:= no > +.else > +MK_${var}:= yes > +.endif > +.else > +.if defined(WITH_${var}) > +MK_${var}:= yes > +.else > +MK_${var}:= no > +.endif > +.endif > +.endfor > + > .if ${MK_CTF} != "no" > CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} > .elif defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300