Discussion:
partially unbreak OpenBSD targets with pcc cvs
Jonathan Gray
2012-08-22 15:47:44 UTC
Permalink
The following diff stops pcc trying to link libpcc which isn't
installed at least, however I still need to comment

strap(&middle_linker_flags, &crtdirs, CRTI, 'p');
strap(&late_linker_flags, &crtdirs, CRTN, 'a');

in cc/cc/cc.c setup_ld_flags() otherwise pcc looks for these
files in the current directory and errors.

This was added in:
revision 1.226
date: 2012/08/05 10:28:42; author: ragge; state: Exp; lines: +543 -649
Change the rest of cc to Joerg's driver code, while trying to not break
too many targets.

The amount of target specific ifdefs in cc.c is rather scary

Index: ccconfig.h
===================================================================
RCS file: /cvsroot/pcc/os/openbsd/ccconfig.h,v
retrieving revision 1.11
diff -u -p -r1.11 ccconfig.h
--- ccconfig.h 5 Aug 2012 14:35:00 -0000 1.11
+++ ccconfig.h 22 Aug 2012 15:29:26 -0000
@@ -37,16 +37,39 @@
#define F77LIBLIST { "-L/usr/local/lib", "-lF77", "-lI77", "-lm", "-lc", NULL };
#endif

+#define CRTO 0
+#define CRTN 0
+
+#define DEFLIBS { "-lc", NULL }
+#define DEFPROFLIBS { "-lc_p", NULL }
+#define DEFCXXLIBS { "-lp++", "-lc", NULL }
+
#if defined(mach_amd64)
-#define CPPMDADD { "-D__amd64__", NULL, }
+#define CPPMDADD \
+ { "-D__x86_64__", "-D__x86_64", "-D__amd64__", "-D__amd64", \
+ "-D__LP64__", "-D_LP64", NULL, }
+#elif defined(mach_arm)
+#define CPPMDADD { "-D__arm__", NULL, }
+#elif defined(mach_hppa)
+#define CPPMDADD { "-D__hppa__", NULL, }
#elif defined(mach_i386)
-#define CPPMDADD { "-D__i386__", NULL, }
-#elif defined(mach_vax)
-#define CPPMDADD { "-D__vax__", NULL, }
+#define CPPMDADD { "-D__i386__", NULL, }
#elif defined(mach_powerpc)
-#define CPPMDADD { "-D__powerpc__", NULL }
+#define CPPMDADD { "-D__powerpc__", NULL, }
+#elif defined(mach_vax)
+#define CPPMDADD { "-D__vax__", NULL, }
#elif defined(mach_sparc64)
-#define CPPMDADD { "-D__sparc64__", NULL }
+#define CPPMDADD { "-D__sparc64__", NULL, }
#else
#error defines for arch missing
#endif
+
+#ifndef PCC_WINT_TYPE
+#define PCC_WINT_TYPE "int"
+#endif
+#ifndef PCC_SIZE_TYPE
+#define PCC_SIZE_TYPE "unsigned long"
+#endif
+#ifndef PCC_PTRDIFF_TYPE
+#define PCC_PTRDIFF_TYPE "long"
+#endif

Loading...