From owner-p4-projects@FreeBSD.ORG Sun Nov 15 09:58:21 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0BE411065676; Sun, 15 Nov 2009 09:58:21 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3EE8106566C; Sun, 15 Nov 2009 09:58:20 +0000 (UTC) (envelope-from remko@elvandar.org) Received: from mailgate.jr-hosting.nl (mailgate.jr-hosting.nl [78.46.126.30]) by mx1.freebsd.org (Postfix) with ESMTP id 5B3528FC08; Sun, 15 Nov 2009 09:58:20 +0000 (UTC) Received: from websrv01.jr-hosting.nl (websrv01 [78.47.69.233]) by mailgate.jr-hosting.nl (Postfix) with ESMTP id 5F6E31CC39; Sun, 15 Nov 2009 10:58:18 +0100 (CET) Received: from a83-163-38-147.adsl.xs4all.nl ([83.163.38.147] helo=axantucar.elvandar.int) by websrv01.jr-hosting.nl with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1N9bsA-000Dh9-7t; Sun, 15 Nov 2009 10:58:18 +0100 Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Remko Lodder In-Reply-To: <200911142333.nAENXWrT017367@repoman.freebsd.org> Date: Sun, 15 Nov 2009 10:58:17 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <1D8EE757-D3A6-43D1-B8CF-40BBE46A8796@elvandar.org> References: <200911142333.nAENXWrT017367@repoman.freebsd.org> To: Rene Ladan X-Mailer: Apple Mail (2.1077) Cc: Perforce Change Reviews Subject: Re: PERFORCE change 170633 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Nov 2009 09:58:21 -0000 On Nov 15, 2009, at 12:33 AM, Rene Ladan wrote: > http://p4web.freebsd.org/chv.cgi?CH=3D170633 >=20 > Change 170633 by rene@rene_self on 2009/11/14 23:32:57 >=20 > [porters handbook] > Add a section about Clang to the "Dos and Don'ts" chapter. > To be reviewed by the clang team and the doc review team. >=20 > Affected files ... >=20 > .. = //depot/projects/docproj_nl/en_US.ISO8859-1/books/porters-handbook/book.sg= ml#50 edit >=20 > Differences ... >=20 > =3D=3D=3D=3D = //depot/projects/docproj_nl/en_US.ISO8859-1/books/porters-handbook/book.sg= ml#50 (text+ko) =3D=3D=3D=3D >=20 > @@ -13602,6 +13602,92 @@ > shorthand solution. > >=20 > + > + Clang: new C/C++ compiler > + > + A future version of &os; will likely have the Clang C/C++ > + compiler as its base compiler. Some modifications to the = Ports > + Collection are necessary. In general, these are write = proper > + ports and write proper source code. = More > + specifically: > + > + > + > + Respect CC and = CXX. Do ^^^ You should probably add something like 'variables' on = the end of the line. > + not any of cc, = c99, > + gcc, c++, or > + g++ directly. What shouldn't we do with 'cc' 'c99' etc? I think we should be more = specific here in terms of 'do not use cc[..] directly. > + > + > + > + Respect LD, do not use > + ld directly. > + > + > + > + Do not use cpp for reformatting = manual > + pages or shell scripts. Try to use something more = suitable > + instead, possibly falling back to = CPP. > + > + > + > + > + If there are link errors related to missing or already > + defined functions, try to add = CSTD=3Dgnu89 to > + Makefile. The function vsnprintf() = is > + already built in. > + > + > + > + The -traditional option is not = supported, > + so existing occurences have to be removed. No concensus = has yet > + been reached on ports abusing this option to preserve = white space > + in text formatting. Note that the Clang preprocessor does = not > + preserve white space. > + > + > + > + Explicit type indication of variables must be used in > + built-in assembler code. > + > + > + > + The main function must be properly declared as ^^^ add : > + > + int main(int argc, char = **argv) > + > + > + > + The maximum useable optimization level is 3. Level 4 = is > + reserved for link-time optimization for the Clang = backend. > + > + > + > + > + > + Some temporary hacks that might be used if all else = fails: > + > + > + > + Adding -fheinous-gnu-extensions. = Note > + that this option is already deprecated. > + > + > + > + Reducing the warning level by adding > + --diasable-werror or > + --disable-strict, or by disabling > + --warn-common or > + -Werror. > + > + > + > + > + > + > > Respect both <makevar>CC</makevar> and > <makevar>CXX</makevar> Thanks for making this! --=20 /"\ Best regards, | remko@FreeBSD.org \ / Remko Lodder | remko@EFnet X http://www.evilcoder.org/ | / \ ASCII Ribbon Campaign | Against HTML Mail and News