From owner-freebsd-doc@FreeBSD.ORG Mon Nov 16 22:47:38 2009 Return-Path: Delivered-To: doc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C12B21065672 for ; Mon, 16 Nov 2009 22:47:38 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by mx1.freebsd.org (Postfix) with ESMTP id 4AF5A8FC15 for ; Mon, 16 Nov 2009 22:47:37 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 9so1928889eyd.9 for ; Mon, 16 Nov 2009 14:47:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :organization:user-agent:mime-version:to:subject:x-enigmail-version :content-type; bh=q+SYpJU6CZCpjso4qojGeC/qb44v4pt5Pyo+TpyUVgg=; b=Ogast+df3zKBwdb0cK/yttaIsrvx6O7Alt2yPcuGL5iZHkXkfDhXXRRiFTY5Hkbw9g SPCrpfqW8TxuNxiYSzrZrnsZ9ItkseMayU1YqxVwskk2aXPbEBr+nug/IDgUzWbxKtgw WX6Se3GFtR6WdIPhllYyMu0PfUNKnntEtDK2Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:organization:user-agent:mime-version:to :subject:x-enigmail-version:content-type; b=Bcp+tYRFCLwyI0u8AutSW4RkQ1T5swNS2lCMKsp3PNFpLDTd65iNTIqGur/1JFRfr6 O/WU+tGsfsLtYdL4Y+GsbLRVPLjrMpC0ApJQ40z+w7NFXEdq+TXnANfqpBts5iAOr3Da cwTZhPh8QRSxHDHfc5oMesbSGbsG0wI48IzJw= Received: by 10.213.109.156 with SMTP id j28mr2072810ebp.79.1258411656252; Mon, 16 Nov 2009 14:47:36 -0800 (PST) Received: from self.rene-ladan.nl (ip4da3ae31.direct-adsl.nl [77.163.174.49]) by mx.google.com with ESMTPS id 24sm6304762eyx.5.2009.11.16.14.47.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 16 Nov 2009 14:47:35 -0800 (PST) Sender: Rene Ladan Message-ID: <4B01D5C9.4080207@freebsd.org> Date: Mon, 16 Nov 2009 23:44:25 +0100 From: Rene Ladan Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.23 (X11/20090826) MIME-Version: 1.0 To: "doc@FreeBSD.org" X-Enigmail-Version: 0.95.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA24CE0F4F79B7318097A72BD" Cc: Subject: [RFC] [patch] Clang section for Porters Handbook X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Nov 2009 22:47:38 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA24CE0F4F79B7318097A72BD Content-Type: multipart/mixed; boundary="------------070207010900080605070008" This is a multi-part message in MIME format. --------------070207010900080605070008 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Hi list, attached is a patch for the Porters Handbook listing some extra rules to = keep in mind when writing ports against the future Clang compiler (see=20 also http://wiki.freebsd.org/BuildingFreeBSDWithClang ). It has already been reviewed by some members of The Clang Team and some=20 doc people. Comments/suggestions/approvals are welcome. Regards, Rene --=20 http://www.rene-ladan.nl/ GPG fingerprint =3D ADBC ECCD EB5F A6B4 549F 600D 8C9E 647A E564 2BFC=20 (subkeys.pgp.net) --------------070207010900080605070008 Content-Type: text/plain; name="phb-clang.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="phb-clang.diff" =3D=3D=3D=3D //depot/projects/docproj_nl/en_US.ISO8859-1/books/porters-ha= ndbook/book.sgml#49 - /home/rene/freebsd/p4/doc/en_US.ISO8859-1/books/por= ters-handbook/book.sgml =3D=3D=3D=3D 13604a13605,13693 > > Clang: new C/C++ compiler >=20 > 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: >=20 > > > Respect the CC and CXX= > variables. Do not use any of the programs cc, > c99, gcc, > c++, or g++ in a port > directly. > >=20 > > Respect LD, do not use > ld in a port directly. > >=20 > > Do not use cpp for reformatting manual > pages or shell scripts. Try to use something more suitable > instead, possibly falling back to CPP.= > > >=20 > > Clang uses the gnu99 standard by default, while GCC uses the= > gnu89 standard by default. Therefore, if there are any linker > errors caused by the different semantics of > inline, compiler errors caused by the use of > reserved C99 keywords (i.e. restrict) or calls to unimplemented > ISO C99 math routines try to add USE_CSTD=3Dgnu89 > to the port Makefile. > >=20 > > 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 spac= e > in text formatting. Note that the Clang preprocessor does not > preserve white space. > >=20 > > Explicit type indication of variables must be used in > built-in assembler code. > >=20 > > The main function must be properly declared as: >=20 > int main(int argc, char **argv) >=20 > or, if there are no parameters, as: >=20 > int main(void) > >=20 > > The maximum useable optimization level is 3. Level 4 is > reserved for link-time optimization for the Clang backend. > >=20 > > >=20 > Some temporary hacks that might be used if all else fails: >=20 > > > Adding -fheinous-gnu-extensions. Note > that this option is already deprecated. > >=20 > > Reducing the warning level by adding > --diasable-werror or > --disable-strict, or by disabling > --warn-common or > -Werror. > > > >=20 --------------070207010900080605070008-- --------------enigA24CE0F4F79B7318097A72BD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAksB1oYACgkQjJ5keuVkK/zNBQCgzj7x1q4EkfMuzBRQicyANoyi SW0AmQE0ICNbfeNdNzzLIxMAgeMXHIz9 =+xTV -----END PGP SIGNATURE----- --------------enigA24CE0F4F79B7318097A72BD--