From owner-freebsd-ports@FreeBSD.ORG Fri May 29 12:36:34 2009 Return-Path: Delivered-To: ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF8461065672; Fri, 29 May 2009 12:36:34 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 613CF8FC0C; Fri, 29 May 2009 12:36:34 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 505E91CD94; Fri, 29 May 2009 14:36:33 +0200 (CEST) Date: Fri, 29 May 2009 14:36:33 +0200 From: Ed Schouten To: ports@FreeBSD.org Message-ID: <20090529123633.GM48776@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Cy+5HEalSgyXkpVS" Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Cc: gerald@FreeBSD.org Subject: Proposal: USE_GNU89 switch X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2009 12:36:35 -0000 --Cy+5HEalSgyXkpVS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi folks, As some of you may have heard, Erwin Lansing (droso) has been helping us folks from the FreeBSD-Clang project [1] to build an entire ports tree with Clang. Even though we're hitting some compiler bugs (crashes, miscompilations, etc), things have been going very good. We noticed there is a certain class of build errors we're seeing, namely related to GNU or ISO C99 style inlining. GCC supported the `inline' keyword long before ISO standardized it, but unfortunately the semantics between GNU and ISO C99 style inlining are not the same. GCC solved this by using ISO C99 style inlining, only when -std=3Dc99 or -std=3Dgnu99 is passed to the compiler. By default it will use -std=3Dgnu89. Clang does a good job at emulating this, but the difference is that it uses gnu99 by default. This is very good in my opinion. ISO C99 is 10 years old. We've noticed some ports (probably less than 100) really depend on GNU-style inlining. One option would be to just ignore the issue, but this will cause problems in the future anyway (by the time GCC itself will switch to gnu99). This is why I'm proposing a USE_GNU89 switch, to force the ports framework to add -std=3Dgnu89 to the CFLAGS. I've been looking through /usr/ports/Mk. I suspect such a switch should be added to bsd.gcc.mk? I'm sending this message to gerald@ as well, because I've been told he is the maintainer of various GCC related bits. --=20 Ed Schouten WWW: http://80386.nl/ [1] http://wiki.freebsd.org/BuildingFreeBSDWithClang --Cy+5HEalSgyXkpVS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkof1tEACgkQ52SDGA2eCwVB9ACdGp8Ge+aouM5CSS2kuUV3prb9 w8sAn10ZaxjtSMWkjmE8TRPb6utUY6br =I7Dc -----END PGP SIGNATURE----- --Cy+5HEalSgyXkpVS--