From owner-freebsd-current@FreeBSD.ORG Wed Oct 17 18:28:01 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA8EC16A419 for ; Wed, 17 Oct 2007 18:28:01 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:610:652::211]) by mx1.freebsd.org (Postfix) with ESMTP id 94C3A13C459 for ; Wed, 17 Oct 2007 18:27:59 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id E3A851CC9F; Wed, 17 Oct 2007 20:27:58 +0200 (CEST) Date: Wed, 17 Oct 2007 20:27:58 +0200 From: Ed Schouten To: Abdullah Ibn Hamad Al-Marri Message-ID: <20071017182758.GU5411@hoeg.nl> References: <132802.25776.qm@web33711.mail.mud.yahoo.com> <20071017173941.GT5411@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="a8kRBn33jkh2Wtq5" Content-Disposition: inline In-Reply-To: <20071017173941.GT5411@hoeg.nl> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: FreeBSD Current Subject: Re: PCC and FreeBSD in the future? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2007 18:28:01 -0000 --a8kRBn33jkh2Wtq5 Content-Type: multipart/mixed; boundary="8jcWiON1L7A8HfS7" Content-Disposition: inline --8jcWiON1L7A8HfS7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ed Schouten wrote: > One of the major obstacles for PCC is that it didn't support a way to > pack structures in a comfortable way. Most of the FreeBSD userland just > built with it. Most of the stuff that didn't compile properly, was > related to kernel headers, using __attribute__ stuff, instead of the > cdef'd stuff, like __packed. It seems things have changed in the mean > time. Indeed; PCC now supports _Pragma("packed"). I've attached a patch for sys/cdefs.h that should make at least src/bin compile like it should. The patch is in no way meant to be complete. --=20 Ed Schouten WWW: http://g-rave.nl/ --8jcWiON1L7A8HfS7 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=pcc-cdefs Content-Transfer-Encoding: quoted-printable --- src/sys/sys/cdefs.h 2006-09-21 03:38:58.000000000 +0200 +++ src/sys/sys/cdefs.h 2007-10-17 19:56:42.000000000 +0200 @@ -111,7 +111,7 @@ /* * Macro to test if we're using a specific version of gcc or later. */ -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__PCC__) #define __GNUC_PREREQ__(ma, mi) \ (__GNUC__ > (ma) || __GNUC__ =3D=3D (ma) && __GNUC_MINOR__ >=3D (mi)) #else @@ -140,7 +140,7 @@ #define __const const /* define reserved names to standard */ #define __signed signed #define __volatile volatile -#if defined(__cplusplus) +#if defined(__cplusplus) || defined(__PCC__) #define __inline inline /* convert to C++ keyword */ #else #if !(defined(__CC_SUPPORTS___INLINE)) @@ -221,6 +221,15 @@ #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) #endif +#if defined(__PCC__) +#define __dead2 +#define __pure2 +#define __unused +#define __used +#define __packed _Pragma("packed") +#define __aligned(x) +#define __section(x) +#endif #endif =20 #if __GNUC_PREREQ__(2, 96) --8jcWiON1L7A8HfS7-- --a8kRBn33jkh2Wtq5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHFlQu52SDGA2eCwURAmBpAJ4/tBT/yF3Y9s0XPp8PtIUKiYYe8gCeIHMH 9XE2KZ7oENzxyhwatUFGBHY= =oGhs -----END PGP SIGNATURE----- --a8kRBn33jkh2Wtq5--