Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Oct 2007 20:27:58 +0200
From:      Ed Schouten <ed@fxq.nl>
To:        Abdullah Ibn Hamad Al-Marri <wearabnet@yahoo.ca>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: PCC and FreeBSD in the future?
Message-ID:  <20071017182758.GU5411@hoeg.nl>
In-Reply-To: <20071017173941.GT5411@hoeg.nl>
References:  <132802.25776.qm@web33711.mail.mud.yahoo.com> <20071017173941.GT5411@hoeg.nl>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <ed@fxq.nl> 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 <ed@fxq.nl>
 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071017182758.GU5411>