Re: PCC and FreeBSD in the future?

From: Abdullah Ibn Hamad Al-Marri <wearabnet_at_yahoo.ca>
Date: Thu, 18 Oct 2007 07:50:33 -0700 (PDT)
----- 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
> _at__at_ -111,7 +111,7 _at__at_
>  /*
>   * 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
> _at__at_ -140,7 +140,7 _at__at_
>  #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))
> _at__at_ -221,6 +221,15 _at__at_
>  #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 
Received on Thu Oct 18 2007 - 12:50:35 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:19 UTC