PCC and FreeBSD in the future?
Abdullah Ibn Hamad Al-Marri
wearabnet at yahoo.ca
Thu Oct 18 07:50:35 PDT 2007
----- Original Message ----
> From: Ed Schouten <ed at fxq.nl>
> To: Abdullah Ibn Hamad Al-Marri <wearabnet at yahoo.ca>
> Cc: FreeBSD Current <freebsd-current at freebsd.org>
> Sent: Wednesday, October 17, 2007 9:27:58 PM
> Subject: Re: PCC and FreeBSD in the future?
>
> * 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.
>
> --
> Ed Schouten
> WWW: http://g-rave.nl/
>
>
> -----Inline Attachment Follows-----
>
> --- 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__ == (ma) && __GNUC_MINOR__ >= (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
>
> #if __GNUC_PREREQ__(2, 96)
Very interesting, I just noticed David O'Brien is the maintainer of the pcc port in the FreeBSD ports, and it was added in Sep, 17, 07, so I think FreeBSD is very interested on it ;)
---
Regards,
-Abdullah Ibn Hamad Al-Marri
Arab Portal
http://www.WeArab.Net/
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the freebsd-current
mailing list