Two openbsd m68k things and one reduce-nag-while-compiling-on-openbsd
Dunno what the snprintf availability expectation is everywhere, but it
seemed like it is used without #ifdefs on lots of other places.
Index: configure
===================================================================
RCS file: /cvsroot/pcc/configure,v
retrieving revision 1.106
diff -u -r1.106 configure
--- configure 28 Mar 2014 19:49:07 -0000 1.106
+++ configure 31 Mar 2014 07:52:54 -0000
@@ -2487,6 +2487,7 @@
vax) targmach=vax ;;
powerpc) targmach=powerpc endian=big ;;
sparc64) targmach=sparc64 endian=big ;;
+ m68k*) targmach=m68k endian=big ;;
x86_64) targmach=amd64 ;;
esac
;;
Index: cc/cxxcom/pftn.c
===================================================================
RCS file: /cvsroot/pcc/cc/cxxcom/pftn.c,v
retrieving revision 1.8
diff -u -r1.8 pftn.c
--- cc/cxxcom/pftn.c 22 Oct 2012 09:25:40 -0000 1.8
+++ cc/cxxcom/pftn.c 31 Mar 2014 07:52:54 -0000
@@ -842,7 +842,7 @@
if (name == NULL) {
static int ancnt;
- sprintf(nbuf, "__%%ANON%d", ancnt++);
+ snprintf(nbuf, sizeof(nbuf),"__%%ANON%d", ancnt++);
name = addname(nbuf);
}
Index: os/openbsd/ccconfig.h
===================================================================
RCS file: /cvsroot/pcc/os/openbsd/ccconfig.h,v
retrieving revision 1.11
diff -u -r1.11 ccconfig.h
--- os/openbsd/ccconfig.h 5 Aug 2012 14:35:00 -0000 1.11
+++ os/openbsd/ccconfig.h 31 Mar 2014 07:52:54 -0000
@@ -47,6 +47,9 @@
#define CPPMDADD { "-D__powerpc__", NULL }
#elif defined(mach_sparc64)
#define CPPMDADD { "-D__sparc64__", NULL }
+#elif defined(mach_m68k)
+#define CPPMDADD { "-D__mc68000__", "-D__mc68020__", "-D__m68k__",
NULL, }
+#define STARTLABEL "_start"
#else
#error defines for arch missing
#endif
Post by Anders MagnussonHi,
I have just added the beginning of 68k support.
It can generate enough code to put out "Hello world", which means that the
remaining to add it almost only instructions :-)
Took about 8 hours to get this far from scratch :-)
-- Ragge
_______________________________________________
Pcc mailing list
http://lists.ludd.ltu.se/cgi-bin/mailman/listinfo/pcc
--
May the most significant bit of your life be positive.