Back to wiki

RCS History

/ TOP / supported-platforms.mdwn

Revision 1.1


The following list describes steps to make PCC the system compiler.

__NetBSD 4.0 (i386/mips/arm/powerpc)__

should support PCC

__NetBSD 3.0 (i386/mips/arm/powerpc)__

The following patch is required:

    --- cdefs.h.orig   2007-12-02 16:45:11.000000000 -0300
    +++ cdefs.h     2007-11-27 02:09:52.000000000 -0300
    @@ -92,7 +92,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(__GNUC__)&& !defined(__lint__)
    @@ -201,6 +201,10 @@
     #define        __packed        __attribute__((__packed__))
     #define        __aligned(x)    __attribute__((__aligned__(x)))
     #define        __section(x)    __attribute__((__section__(x)))
    +#elif defined(__PCC__)
    +#define        __packed        /* not yet */
    +#define        __aligned(x)    /* not yet */
    +#define        __section(x)    /* not yet */
     #elif defined(__lint__)
     #define        __packed        /* delete */
     #define        __aligned(x)    /* delete */
    @@ -245,7 +249,7 @@
     #endif /* _KERNEL */
 
     #if !defined(_STANDALONE)&& !defined(_KERNEL)
    -#if defined(__GNUC__)
    +#if defined(__GNUC__) || defined(__PCC__)
     #define        __RENAME(x)     ___RENAME(x)
     #else
     #ifdef __lint__
    --- stdlib.h.orig       2007-12-02 16:47:42.000000000 -0300
    +++ stdlib.h    2007-11-30 19:48:58.000000000 -0300
    @@ -237,6 +237,8 @@
     #if defined(alloca)&& (alloca == __builtin_alloca)
           && defined(__GNUC__) && (__GNUC__ < 2)
     void   *alloca(int);     /* built-in for gcc */ 
    +#elif defined(__PCC__)
    +#define alloca(size)   __builtin_alloca(size)
     #else 
     void   *alloca(size_t); 
     #endif /* __GNUC__ */

Additionally, for stdargs to work properly, changes to the machine-dependent stdargs.h is required (something like this):

    --- mips/stdarg.h.orig       2007-12-02 17:02:55.000000000 -0300
    +++ mips/stdarg.h    2007-12-02 17:01:59.000000000 -0300
    @@ -59,6 +59,13 @@
     #define va_end(ap)             __builtin_va_end((ap))
     #define __va_copy(dest, src)   __builtin_va_copy((dest), (src))
 
    +#elif defined(__PCC__)
    +
    +#define va_start(ap, last)     __builtin_stdarg_start((ap), last)
    +#define va_arg(ap, type)       __builtin_va_arg((ap), type)
    +#define va_end(ap)             __builtin_va_end((ap))
    +#define __va_copy(dest, src)   __builtin_va_copy((dest), (src))
    +
     #else
 
     #define        va_start(ap, last) \

__Mac OS X 10.4 (powerpc)__

Many OS X header files use the preprocessor directive #pragma pack(), which isn't supported by PCC.  Ignore the warning for the moment and hope that it doesn't matter too much.

Additionally, stdargs.h only works with gcc.  Paste the following lines into /usr/local/lib/pcc/stdarg.h:

    #ifndef _STDARG_H_
    #define _STDARG_H_

    #define va_list char *
    #define _VA_LIST

    #define va_start(ap, last)      __builtin_stdarg_start((ap), last)
    #define va_arg(ap, type)        __builtin_va_arg((ap), type)
    #define va_end(ap)              __builtin_va_end((ap))
    #define va_copy(dest, src)      __builtin_va_copy((dest), (src))
    #define va_end(ap)              ((void)0)

    #endif

__Debian__

There have been reports that Debian header files depend on gcc.  No patches have been supplied yet.


Powered by rcshistory.cgi 0.3