From owner-p4-projects@FreeBSD.ORG Sat Nov 14 23:33:32 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C00B51065698; Sat, 14 Nov 2009 23:33:32 +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 6BD831065694 for ; Sat, 14 Nov 2009 23:33:32 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 58AAB8FC18 for ; Sat, 14 Nov 2009 23:33:32 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id nAENXWAO017369 for ; Sat, 14 Nov 2009 23:33:32 GMT (envelope-from rene@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id nAENXWrT017367 for perforce@freebsd.org; Sat, 14 Nov 2009 23:33:32 GMT (envelope-from rene@FreeBSD.org) Date: Sat, 14 Nov 2009 23:33:32 GMT Message-Id: <200911142333.nAENXWrT017367@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rene@FreeBSD.org using -f From: Rene Ladan To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 170633 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2009 23:33:33 -0000 http://p4web.freebsd.org/chv.cgi?CH=170633 Change 170633 by rene@rene_self on 2009/11/14 23:32:57 [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. Affected files ... .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/porters-handbook/book.sgml#50 edit Differences ... ==== //depot/projects/docproj_nl/en_US.ISO8859-1/books/porters-handbook/book.sgml#50 (text+ko) ==== @@ -13602,6 +13602,92 @@ shorthand solution. + + 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 + not any of cc, c99, + gcc, c++, or + g++ 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=gnu89 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 + + 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>