gcc 3.2 issues.  asm fixes.  Make sure we clean up when we make a new hash.

diff --git a/include/stdio.h b/include/stdio.h
index 7bcf32e..d51e969 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -66,6 +66,9 @@
 
 __extern int fputs(const char *, FILE *);
 __extern int puts(const char *);
+__extern int fputc(int, FILE *);
+#define putc(c,f)  fputc((c),(f))
+#define putchar(c) fputc((c),stdout)
 
 __extern size_t _fread(void *, size_t, FILE *);
 __extern size_t _fwrite(const void *, size_t, FILE *);
diff --git a/klibc/Makefile b/klibc/Makefile
index e3ecdb5..23a8f34 100644
--- a/klibc/Makefile
+++ b/klibc/Makefile
@@ -19,7 +19,7 @@
 	  execl.o execle.o execv.o execvpe.o execvp.o execlp.o execlpe.o \
 	  fork.o wait.o wait3.o waitpid.o setpgrp.o \
 	  printf.o vprintf.o fprintf.o vfprintf.o perror.o \
-	  fopen.o fread.o fread2.o fwrite.o fwrite2.o fputs.o puts.o \
+	  fopen.o fread.o fread2.o fwrite.o fwrite2.o fputc.o fputs.o puts.o \
 	  sleep.o usleep.o raise.o abort.o assert.o alarm.o pause.o \
 	  signal.o siglist.o siglongjmp.o \
 	  sigaction.o sigpending.o sigprocmask.o sigsuspend.o \
@@ -77,11 +77,11 @@
 	$(NM) $(SOLIB) | \
 		egrep '^[0-9a-fA-F]+ [ADRTW] ' | \
 		sort | $(PERL) md5hash.pl > $@
-	ln -s $(SOLIB) klibc-`cat $@`.so
 
 $(SOHASH): $(SOLIB) $(SOLIB).hash
 	cp -f $(SOLIB) $@
 	$(STRIP) $@
+	rm -f klibc-??????????????????????.so
 	ln -f $@ klibc-`cat $(SOLIB).hash`.so
 
 interp.o: interp.S $(SOLIB).hash
diff --git a/klibc/fputc.c b/klibc/fputc.c
new file mode 100644
index 0000000..61aff16
--- /dev/null
+++ b/klibc/fputc.c
@@ -0,0 +1,14 @@
+/*
+ * fputc.c
+ *
+ * gcc "printf decompilation" expects this to exist...
+ */
+
+#include <stdio.h>
+
+int fputc(int c, FILE *f)
+{
+  unsigned char ch = c;
+
+  return _fwrite(&ch, 1, f) == 1 ? ch : EOF;
+}
diff --git a/klibc/include/stdio.h b/klibc/include/stdio.h
index 7bcf32e..d51e969 100644
--- a/klibc/include/stdio.h
+++ b/klibc/include/stdio.h
@@ -66,6 +66,9 @@
 
 __extern int fputs(const char *, FILE *);
 __extern int puts(const char *);
+__extern int fputc(int, FILE *);
+#define putc(c,f)  fputc((c),(f))
+#define putchar(c) fputc((c),stdout)
 
 __extern size_t _fread(void *, size_t, FILE *);
 __extern size_t _fwrite(const void *, size_t, FILE *);
diff --git a/klibc/memcpy.c b/klibc/memcpy.c
index bd84822..3130aa8 100644
--- a/klibc/memcpy.c
+++ b/klibc/memcpy.c
@@ -9,12 +9,14 @@
   const char *p = src;
   char *q = dst;
 #if defined(__i386__)
+  size_t nl = n >> 2;
   asm volatile("cld ; rep ; movsl ; movl %3,%0 ; rep ; movsb"
-	       : "+c" (n >> 2), "+S" (p), "+D" (q)
+	       : "+c" (nl), "+S" (p), "+D" (q)
 	       : "r" (n & 3));
 #elif defined(__x86_64__)
+  size_t nq = n >> 3;
   asm volatile("cld ; rep ; movsq ; movl %3,%%ecx ; rep ; movsb"
-	       : "+c" (n), "+S" (p), "+D" (q)
+	       : "+c" (nq), "+S" (p), "+D" (q)
 	       : "r" ((uint32_t)n & 7));
 #else
   while ( n-- ) {
diff --git a/klibc/memset.c b/klibc/memset.c
index 572f834..93a0673 100644
--- a/klibc/memset.c
+++ b/klibc/memset.c
@@ -9,12 +9,14 @@
   char *q = dst;
 
 #if defined(__i386__)
+  size_t nl = n >> 2;
   asm volatile("cld ; rep ; stosl ; movl %3,%0 ; rep ; stosb"
-	       : "+c" (n >> 2), "+D" (q)
+	       : "+c" (nl), "+D" (q)
 	       : "a" ((unsigned char)c * 0x01010101U), "r" (n & 3));
 #elif defined(__x86_64__)
+  size_t nq = n >> 3;
   asm volatile("cld ; rep ; stosq ; movl %3,%%ecx ; rep ; stosb"
-	       : "+c" (n >> 3), "+D" (q)
+	       : "+c" (nq), "+D" (q)
 	       : "a" ((unsigned char)c * 0x0101010101010101U,
 		      "r" ((uint32_t)n & 7));
 #else