The following list describes steps to make PCC the system compiler.
__Microsoft Windows__
You must install the w32api and mingw-runtime libraries available from the [pcc ftp server](http://pcc.ludd.ltu.se/ftp/pub/win32/). These libraries expand into the /usr/local/i386-pe/ directory. You can copy these files to your windows machine and follow the directions [here](http://pcc.ludd.ltu.se/building/) for compiling on the Microsoft Windows platform.
__Debian GNU/Linux 4.0r0__
You must build and install the pcc-libs module which contains libpcc.a and stddef.h header files.
__SuSE Linux Ent Svr 10__
You must build and install the pcc-libs module which contains libpcc.a and stddef.h header files.
__Mandriva Corporate Server 4.0__
You must build and install the pcc-libs module which contains libpcc.a and stddef.h header files.
__Red Hat Ent Linux 5__
You must build and install the pcc-libs module which contains libpcc.a and stddef.h header files.
__NetBSD 4.0 (i386/mips/arm/powerpc)__
NetBSD 4.0 needs at least this change:
--- sys/sys/cdefs.h 13 Nov 2006 05:44:37 -0000 1.64
+++ sys/sys/cdefs.h 12 Apr 2008 13:30:29 -0000
@@ -245,7 +245,7 @@
#endif /* _KERNEL */
#if !defined(_STANDALONE)&& !defined(_KERNEL)
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__PCC__)
#define __RENAME(x) ___RENAME(x)
#else
#ifdef __lint__
and for varargs to work on arm:
--- sys/arch/arm/include/stdarg.h 11 Dec 2005 12:16:47 -0000 1.9
+++ sys/arch/arm/include/stdarg.h 12 Apr 2008 13:36:13 -0000
@@ -46,7 +46,7 @@
#define __builtin_va_copy(d, s) ((d) = (s))
#endif
-#if __GNUC_PREREQ__(2, 96)
+#if (__GNUC_PREREQ__(2, 96) || defined(__PCC__))
#define va_start(ap, last) __builtin_stdarg_start((ap), (last))
#define va_arg __builtin_va_arg
#define va_end __builtin_va_end
A similar change may be required for other platforms as well.
__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)__
You must build and install the pcc-libs module which contains libpcc.a
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))
#endif
__Mac OS X 10.5 (powerpc)__
You must build and install the pcc-libs module which contains libpcc.a.
Some of the issues may apply from OS X 10.4 discussed above.
__Mac OS X 10.5 (intel)__
You must build and install the pcc-libs module which contains libpcc.a.
Some of the issues may apply from OS X 10.4 discussed above.
Currently has a bug with 16-byte stack alignment.Powered by rcshistory.cgi 0.3